1 Reply Latest reply on Nov 20, 2006 7:40 AM by arunbe

    Stop execution thread with an Alert component

    oceanfeeling
      Hi,

      since ActionScript is asynchronous, can I use an Alert component to halt the execution thread and wait for the user response?

      i.e. The code below,
      Alert.show("Message", "Title", Alert.YES | Alert.NO, this, alertHandler);
      trace("hello");

      will pop up the Alert window but the traced message will be displayed (in Flash Help, it is stated that in OSs like Windows this should have displayed the Alert window, but the traced message would not appear before the user made a choice).

      One solution would be

      var alertHandler:Object = new Object();
      alertHandler.click = function(evt) {
      if(evt.detail == Alert.YES) {
      trace("hello");
      }
      }

      Alert.show("Message", "title", Alert.YES | Alert.NO, this, alertHandler);

      I was wondering if I could use the first fragment of code above

      Thank you