Accessing Object Methods : Object « Class « Flash / Flex / ActionScript






Accessing Object Methods

 

package{
  import flash.display.Sprite;
  
  public class Main extends Sprite{
    public function Main(){
        var sTitle:String = new String("ActionScript ABC");
        var sSubject:String = sTitle.substr(0, 12);
        trace(sSubject);  // Displays: ActionScript
    }
  }
}

        








Related examples in the same category

1.Creating an Object: var variableName:datatype = new ClassName();
2.Using the dot (.) operator to create the same variable causes an error because it violates the syntactic rules for identifiers:
3.Accessing Object Properties
4.Using Objects as Associative Arrays
5.Testing for Existence
6.Use this operator to investigate instances of classes for methods and public properties
7.Removing Properties