flash on 2010-1-25
♥0 |
Line 31 |
Modified 2010-01-25 13:42:28 |
MIT License
archived:2017-03-20 12:38:05
ActionScript3 source code
/**
* Copyright tan_go238 ( http://wonderfl.net/user/tan_go238 )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/rfBC
*/
package {
import flash.display.*;
import flash.events.*;
import flash.net.URLRequest;
import flash.system.LoaderContext;
public class TopImage extends MovieClip {
static public const IMAGE_URL_1:String = "http://farm4.static.flickr.com/3204/2662752901_15864d11c3.jpg";
static public const IMAGE_URL_2:String = "http://farm4.static.flickr.com/3170/2662752833_c3fb0c76a4.jpg";
private var loader1:Loader;
private var loader2:Loader;
public function TopImage() {
loader1 = new Loader();
loader1.contentLoaderInfo.addEventListener(Event.COMPLETE, function(e:Event):void {
loader2= new Loader();
loader1.contentLoaderInfo.addEventListener(Event.COMPLETE, function(e:Event):void {
init();
});
loader2.load(new URLRequest(IMAGE_URL_2));
});
loader1.load(new URLRequest(IMAGE_URL_1));
}
private function init():void{
var bd1:BitmapData = new BitmapData(loader1.width, loader1.height);
var bd2:BitmapData = new BitmapData(loader2.width, loader2.height);
bd1.draw(loader1);
var bm1:Bitmap = new Bitmap(bd1);
bm1.x = 0;
addChild(bm1);
}
}
}