PDA

View Full Version : modaldialog doesn't stop code execution


aows
02-08-2005, 08:03 PM
Hi there. I just started using the modaldialog and noticed that when open() is called from script, it doesn't block code execution. I wonder why this is. In other languages, ie swing, a modal dialog can be used to stop anything from happenning, thus being able to do things like showing several dialog in sequence.

A little hack here would be to show dialogs in inverted sequence and make sure they cover each other and can't be moved, but it's a hack...

What are your thoughts on this? Can code execution be stoped until a dialog is closed some other way?

Thanks!

metasarah
02-09-2005, 04:40 AM
Modal Dialogs prevent the user from interacting with the rest of the app (keyboard and mouse events), but it does not prevent execution if you have code that responds to idle or other events. You can stack one modal dialog on top of another, if you like.

Ideally you would be able to call, alert() or whatever and it would not return until the user had dismissed the dialog, but the script engine in Flash has a single thread of execution. To use the modaldialog class, you need to create separate methods for success and failure and call those after you close the dialog.

Sarah

aows
02-09-2005, 08:49 AM
Thanks for the reply... I agree you can achive what my example said by using a few events here and there...

I understand now why the modaldialog behaves like it does... It's just a bit different than what i expected and wanted to know why...

Thanks a lot again for the response...