# Wait in Actionscript, until

**URL:** <https://forum.kirupa.com/t/wait-in-actionscript-until/75551>\
**Category:** Uncategorized\
**Created:** [January 10, 2005, 5:10am UTC](https://forum.kirupa.com/t/wait-in-actionscript-until/75551 "2005-01-10T05:10:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bugmenot\_guest](https://avatars.discourse-cdn.com/v4/letter/b/58f4c7/32.png) [@bugmenot\_guest](https://forum.kirupa.com/u/bugmenot_guest)\
**Post date:** [January 10, 2005, 5:10am UTC](https://forum.kirupa.com/t/wait-in-actionscript-until/75551/1 "2005-01-10T05:10:58Z")

</div>

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):

```auto
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

```auto
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!
