package{
import flash.display.Loader;
import flash.display.Sprite;
import flash.events.Event;
import flash.net.URLRequest;
public class LoadingSWF extends Sprite{
private var loader:Loader = new Loader();
public function LoadingSWF (){
loader.contentLoaderInfo.addEventListener( Event.INIT, onLoaderInit );
loader.load( new URLRequest( "ExampleB.swf" ) );
}
private function onLoaderInit( event:Event ):void
{
Object( loader.content ).init( "passing" );
}
}
}
/*=======================================*/
child/loaded swf:
package{
import flash.display.Sprite;
public class LoadedSWF extends Sprite{
public function LoadedSWF (){
}
public function init( value:String):void{
trace(value);
}
}
}
沒有留言:
張貼留言