Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package;
- import flash.display.MovieClip;
- import flash.Lib;
- class Main extends MovieClip
- {
- var test:String;
- public function new()
- {
- super();
- test = "hello world";
- var s = "test";
- trace(untyped this[s]); //hello world
- foo(s); // String should be Int, For function argument 's'
- }
- function foo(s):Void
- {
- trace(untyped this[s]);
- }
- public static function main()
- {
- Lib.current.addChild(new Main());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment