jan_flanders

Untitled

May 7th, 2012
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package;
  2. import flash.display.MovieClip;
  3. import flash.Lib;
  4.  
  5. class Main extends MovieClip
  6. {
  7.     var test:String;
  8.     public function new()
  9.     {
  10.         super();
  11.         test = "hello world";
  12.        
  13.         var s = "test";
  14.        
  15.         trace(untyped this[s]); //hello world
  16.         foo(s); // String should be Int,  For function argument 's'
  17.     }
  18.     function foo(s):Void
  19.     {
  20.         trace(untyped this[s]);
  21.     }
  22.     public static function main()
  23.     {
  24.         Lib.current.addChild(new Main());
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment