Class Level (Static) Variables and Methods are accessed by using the class name followed by the object name : Variable scope : Data Type Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Data Type » Variable scope »

 

Class Level (Static) Variables and Methods are accessed by using the class name followed by the object name


 

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

        trace(ScopeTest.foo)// Displays: bar

    }
  }
}
 class ScopeTest {
      public static var foo:String = "bar";
   }

        



Leave a Comment / Note


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


Flash / Flex / ActionScript examples

 Navioo Data Type
» Variable scope