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
- {
- public static function main()
- {
- getEvents(new flash.text.TextField());
- }
- public static function getEvents(tf:Dynamic)
- {
- if (Std.is(tf, flash.events.IEventDispatcher))
- {
- test1(tf);
- test2(tf);
- test3(tf);
- }
- }
- public static function test1(tf)
- {
- trace(tf);//[object TextField]
- trace(Std.is(tf,String));// true
- if (1==2)
- {
- var s:String = tf;
- }
- }
- public static function test2(tf)
- {
- trace(tf);//0
- trace(Std.is(tf,Int));// true
- if(1==2)
- {
- var i:Int = tf;
- }
- }
- public static function test3(tf)
- {
- trace(tf);//true
- trace(Std.is(tf,Bool));// true
- if(1==2)
- {
- var i:Bool = tf;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment