Posted by matthew.lukas in SWF Studio V3 on Mar 18 2008, 06:00 am

I am looking for a way to pause action script like the way showInputBox does.
showInputBox would work great if i could add more input fields. is there a way to use your own movie clip as a inputbox that pause for user input before continuing script? Any help would be appreciated.
Matt


Posted by AGo in SWF Studio V3 on Mar 18 2008, 06:27 am

well, you could use AGosTools.sleep , but I'm not sure if that would be of any use for you.

If you need a custom input box you'd either have to code a plugin by yourself for that (or have somebody doing that for you) or you handle it all via Flash and a custom movieclip.


Posted by matthew.lukas in SWF Studio V3 on Mar 18 2008, 08:30 am

thanks the plugin is handy, but does not help in this case. I wonder why there is not any command already made. Since opening a dialog box, or error message box, stops script from running until you click ok or cancel. That is all i need. I am making a player that looks in a folder for video files and then would open a dialog box that asks user to enter a description as well as desired keywords for that video if there is no description yet. Thanks for any help
matt


Posted by AGo in SWF Studio V3 on Mar 18 2008, 08:47 am

well, you really don't want to use dialog boxes as "scriptstopper".

What they are actually doing is not blocking the actionscript, but blocking the whole flash player including all animations and other timelines.
If the user needs too long to dismiss the dialog you'll get a slow-script warning from the flash player.

You should really re-organize your code to have it like:


doPreparationStuff();
var userInput = askUserForInput();
useUsersInput(userInput);


Think of it like breaking your code into seperated units, which have nothing in common except parameters passed to them and returned from other functions.

Then you can easily "block" your code by executing the useUsersInput() function only after the user set the values. You can then do the actual "dialog" via a custom movielclip and a custom ok-button that calls useUsersInput().

Now, the reason why there is no function like that is quite easy:
the ssCore.App.showMessageBox et. al. functions are simply wrapped calls to WinAPI function, and the basic WinAPI simply does not offer such functionality, only the parameters/dialogs exposed by SWF Studio.

hth


Posted by AmerSoft in SWF Studio V3 on Mar 19 2008, 02:54 am


QUOTE: from matthew.lukas;43673
I wonder why there is not any command already made. Since opening a dialog box, or error message box, stops script from running until you click ok or cancel. That is all i need.

As Tim said before , if you freeze (pause) your application using an ActionScript API command, the unfreeze command will not work after that ...