jan_flanders

Untitled

May 8th, 2012
80
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.events.IEventDispatcher;
  4. import flash.Lib;
  5. import flash.text.TextField;
  6.  
  7. class Main extends MovieClip
  8. {
  9.     public static function main()
  10.     {
  11.         var tf:TextField = new TextField();
  12.         getEvents(tf);
  13.     }
  14.     public static function getEvents(tf:Dynamic)
  15.     {
  16.         if (Std.is(tf, IEventDispatcher))
  17.         {
  18.             test1(tf);
  19.             test2(tf);
  20.             test3(tf);
  21.         }
  22.     }
  23.     public static function test1(tf)
  24.     {
  25.         if (Std.is(tf,String))
  26.         {
  27.             trace("tf is a String");
  28.             var s:String = tf;
  29.         }
  30.     }
  31.     public static function test2(tf)
  32.     {
  33.         if(Std.is(tf,Int))
  34.         {
  35.             trace("tf is an Int");
  36.             var i:Int = tf;
  37.         }
  38.     }
  39.     public static function test3(tf)
  40.     {
  41.         if(Std.is(tf,Bool))
  42.         {
  43.             trace("tf is a Bool");
  44.             var b:Bool = tf;
  45.         }
  46.     }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment