0 Replies Latest reply on Jun 12, 2011 4:54 AM by Maglez

    Alert.show() - How to set useHandCursor

    Maglez

      Hello,

       

      I have been looking for a way to set useHandCursor and buttonMode for the buttons on an Alert window using ActionScript 3. I searched for a while on Internet but could not find a solution. Finally I had a look at the class itself, its inheritance hierarchy and finally I realised how to do it and I wanted to let others know...

       

      I was showing alert pop-up windows by using only its static methods...

       

      Alert.yesLabel = "yes";
      Alert.noLabel = "no"
      Alert.show("text", "title", and other stuff);

       

      ...and I was expecting to have a static access to useHandCursor too, which is wrong.

       

      The Alert class, through its inheritance hierarchy, inherits the useHandCursor and buttonMode from the Sprite class...

       

      Alert > Panel > Container > UIComponent > FlexSprite > Sprie

       

      ...and the Alert.show() method returns an Alert object, there is where you set thopse properties.

       

      var alertInstance:Alert = new Alert();
      Alert.yesLabel = "yes";
      Alert.noLabel = "no"
      alertInstance = Alert.show("text", "title", and other stuff);
      alertInstance.buttonMode = true;
      alertInstance.useHandCursor = true;

       

      I hope it is of use to someone :-)