[sourcecode language=”actionscript3″]
package {
/*
the main swf that loads everything, starting with assets swf…
*/
import flash.display.*;
import flash.net.URLRequest;
import flash.utils.*;
import flash.events.Event;</code>
public class Requiem extends MovieClip {
private var AssetLoader:Loader;
private var Request:URLRequest;
private var AssetsURL:String = "RequiemAssets.swf"
public function Requiem (){
var Request = new URLRequest(AssetsURL)
var AssetLoader = new Loader()
AssetLoader.load(Request)
AssetLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete)
}
private function onComplete(e:Event):void{
trace ("Load Complete")
var ldrInfo = e.currentTarget as LoaderInfo;
ldrInfo.removeListener (Event.COMPLETE, onComplete)
var assets:MovieClip = e.currentTarget as MovieClip;
var Home:Class = assets.loaderInfo.applicationDomain.getDefinition("home")
var home:MovieClip = new Home()
addChild (home)
}
}
}
[/sourcecode]
用黎 load 一個 swf,拎佢 library 裡面d 野出黎