您好我正在从加载程序文件中加载三个swf。 每个都加载在不同的场景上。 有一个交换机场景,它将用户移动到下面的AS3代码加载文件的相关场景。
var swf3:MovieClip;
var Sim3:Loader = new Loader();
this.addChild(Sim3);
Sim3.load(new URLRequest("sim12.swf"))
// add that instance to the display list, adding it to the Stage at 0,0
Sim3.x = 0;// move the loaded SWF 0 pixels to the right (from the left edge)
Sim3.y = 0;
每个swf通过调用每个场景特别描述的加载器文件中的函数来关闭;
removeChild(Sim3);
Sim3.unloadAndStop();
Sim3 = null;
swf3=null;
然后通过以下语句移动到下一个场景
this.nextScene();
现在的问题是,当用户第一次选择时,所有文件都从交换机正确打开,并且同样发生在第二次但第三次,无论用户选择打开什么文件,它都会加载子swf文件1st通过单击按钮移动到第2页的页面。但点击按钮不起作用,你继续点击它,它不起作用。
有人可以帮忙???
切换台代码:
var ProgressGrid:DataGrid = new DataGrid;
ProgressGrid.move(55.25,306);
ProgressGrid.setRendererStyle("textFormat", tf1);
ProgressGrid.setRendererStyle("headerTextFormat", tf2);
ProgressGrid.width = 690.5;
ProgressGrid.height = 231;
ProgressGrid.rowHeight = 20;
ProgressGrid.headerHeight = 50;
ProgressGrid.allowMultipleSelection = false;
ProgressGrid.selectable = true;
ProgressGrid.columns = ["Serial","Simulation Title","IG Score","DM Score","Time Taken","Status"];
ProgressGrid.columns[0].width = 45;
ProgressGrid.columns[1].width = 250;
ProgressGrid.columns[2].width = 69;
ProgressGrid.columns[3].width = 69;
ProgressGrid.columns[4].width = 75;
ProgressGrid.columns[5].width = 69;
ProgressGrid.addItem({ "Serial":1 , "Simulation Title":"Title1" , "IG Score":IG1 , "DM Score":DM1 , "Time Taken":TS1 , "Status":LS1});
ProgressGrid.addItem({ "Serial":2 , "Simulation Title":"Title2" , "IG Score":IG2 , "DM Score":DM2 , "Time Taken":TS2 , "Status":LS2});
ProgressGrid.addItem({ "Serial":3 , "Simulation Title":"Title3" , "IG Score":IG3 , "DM Score":DM3 , "Time Taken":TS3 , "Status":LS3});
addChild(ProgressGrid);
stop();
ProgressGrid.addEventListener(Event.CHANGE,gridItemClick);
function gridItemClick(event:Event):void
{
sel = Number(event.target.selectedItem.Serial);
if (sel==1)
{
gotoAndPlay(1,"Scene 3");//will move to the scene where Sim10 will be loaded
}
else
if (sel==2)
{
gotoAndPlay(1,"Scene 4");//will move to the scene where Sim11 will be loaded
}
else
if (sel==3)
{
gotoAndPlay(1,"Scene 5");//will move to the scene where Sim12 will be loaded
}
}