fun with tweens
authorRichard Fairhurst <richard@systemed.net>
Mon, 18 Oct 2010 06:29:56 +0000 (06:29 +0000)
committerRichard Fairhurst <richard@systemed.net>
Mon, 18 Oct 2010 06:29:56 +0000 (06:29 +0000)
net/systemeD/halcyon/TileSet.as

index f91bc467fcffe5ab525ddd103711a52477ffa16a..29ddfda63f3a01138c3924a9048148214473718a 100755 (executable)
@@ -4,8 +4,9 @@ package net.systemeD.halcyon {
        import flash.events.*;
        import flash.net.*;
        import flash.system.LoaderContext;
+       import flash.utils.Timer;
        import net.systemeD.halcyon.MapEvent;
-       
+
     public class TileSet extends Sprite {
 
                public var tile_l:int;
@@ -111,9 +112,18 @@ package net.systemeD.halcyon {
                }
 
                protected function doImgInit(event:Event):void {
+                       event.target.loader.alpha=0;
+                       var t:Timer=new Timer(10,10);
+                       t.addEventListener(TimerEvent.TIMER,function():void { upFade(DisplayObject(event.target.loader)); });
+                       t.start();
                        waiting--;
                        return;
                }
+               
+               protected function upFade(s:DisplayObject):void {
+                       s.alpha+=0.1;
+                       trace(s+","+s.alpha);
+               }
 
                
                // Assemble tile URL