Use this operator to investigate instances of classes for methods and public properties : Object : Class Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Class » Object »

 

Use this operator to investigate instances of classes for methods and public properties


 


package{
  import flash.display.Sprite;
  
  public class Main extends Sprite{
    public function Main(){

         var sprite:Sprite = new Sprite();
         trace("alpha" in sprite)// Displays true
         trace("getChildAt" in sprite)// Displays true
         var person:Person = new Person("Ben");
         trace("name" in person)// Displays true
         trace("SSN" in person)// Displays false

    }
  }
}
 class Person
 {
     public var name:String;
     private var SSN:Number;
     public function Person(name:String)
     {
         this.name = name;
     }
 }

        



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


Flash / Flex / ActionScript examples

 Navioo Class
» Object