var loader:Loader=new Loader();
var url:URLRequest=new URLRequest();
var mc;
var myurl:Array=["18.swf","19.swf","22.swf","24.swf","12.swf"];
var myindex:int=new int ;
myindex=0;
url.url=myurl[myindex];
loader.load(url);
addChild(loader);
this.swapChildren(add_btn,loader);
add_btn.addEventListener(MouseEvent.CLICK,onclick);
function onclick(event:MouseEvent):void {
mc=this.getChildAt(0);
mc.unloadAndStop();//停止swf的播放
// mc=null;
this.removeChild(mc);
loader.unload();
index();
url.url=myurl[myindex];
loader.load(url);
addChild(loader);
this.swapChildren(add_btn,loader);
}
function index() {
myindex++;
if (myindex>myurl.length-1) {
myindex=0;
}
}