1 Reply Latest reply on Jun 1, 2010 10:18 PM by Dajji

    How to set data inside the ActionScript setter Method

    kiran7881 Level 1

      I am able to directly set the Values in the Properties of a Action class .

       

      For example , assume ModuleLocator is my Action class name .

       

      var myclass:ModuleLocator = new ModuleLocator();

      myclass.user="Admin";

       

      I want to have something like , which is avialable in Java Bean to throw an exception on to the setter
      Method when the value is equal to something which we aren't expecting as shown :

       

      public void setName(String name)
      {

      if(name.equals("Admin"))
      {
      throw new Exception();
      }
      }

       

      If  this is  possible  Action Script class , how to call the ActionScript setter so that the value would be automatically set into the property of the ActionScript class .

       

      Thanks in advance .