0 Replies Latest reply on Aug 18, 2006 8:04 AM by Newsgroup_User

    Alert component problem

    Level 7
      I am getting the following error message from Flash 8 for the Alert
      component. It worked fine in MX 2004 What has happened?

      **Error** Scene=Scene 1, layer=ALERT, frame=1:Line 37: There is no
      property with the name 'hide'.
      Alert.hide;

      Total ActionScript Errors: 1 Reported Errors: 1

      This is my code



      //ALERT SYSTEM
      import mx.controls.Alert;
      Alert.yesLabel = "S�";
      Alert.noLabel = "No";
      // create the button listener
      myButtonListener = new Object();
      // create the click method on the listener
      // to listen for button clicks
      myButtonListener.click = function ()
      {
      // Display an alert
      // where the message is "Oh no, you did..."
      // and the title of the dialog is "Very Bad Error".
      // Show a NO and CANCEL button and make the
      // NO button the default button.
      Alert.show
      (
      "�Desea regresar al Men� Central?",
      "Salida de Lecci�n",
      Alert.NO | Alert.YES,
      _root, alertHandler,
      Alert.NO
      );
      ;
      }

      // make the myButtonListener listener listen
      // for click events on myButton
      salida_btn.addEventListener("click", myButtonListener );
      // create the alert handler callback
      alertHandler = function ( theEvent )
      {
      // check which button the user pressed
      if (theEvent.detail == Alert.NO)
      {
      // no button
      Alert.hide;
      }
      else if (theEvent.detail == Alert.YES)
      {
      // cancel button
      loadMovie("menu/menucentral.swf",_root);
      }
      }