Wait in Actionscript, until

hi.

do you guys now the Alert Component? it is like pain it the a**.
but i’ve customized the code a bit to have the kind of functionality
that VB has.

untill now to use the Alert you’d have to (light version):

msgBox("are you happy?","Poll","YES|NO","icoQuestion");
  trace("after the msgbox");

if you’d have to display more than one AlertBox, you would have to write a separate code
for each and one of them. not mentioning the responders and customizeing the buttons, or whatever you’d have to write much much more.

i’ve made it simple. now i just go like msgBox(“hello”, […]) and you can you can du whatever you want just with one call of the function.

i want it also to return a value, witch represents a clicked button (ok, cancel, whatever). but the problem is,
that flash goes running the code even if i dont press a thing.

if i have a code like

if(msgBox("are you happy?","Poll","YES|NO","icoQuestion")=="YES"){
  	trace("good for you");
  }else{
  	trace("thats too bad");
  }

i know that i can set the clickHandler (responder) to the Alert, but that’s now what i want. clickHandler is executed when user clicks on one of the buttons, thats true,
but it doesnt stop the reat os AS to be executed. and thats what i want.

i want the AS to wait in place, untill someone pressed the button.
any ideas how to do that?

thanks for your time.
take care!