我現在要去load網頁圖片 假設要呈現5張圖 分別是 No1 ~ 5
執行出來也都正常(5張圖都有載入並顯示)
但是順序就是有問題 我想應該是 Event.COMPLETE 的問題
可能是圖片大小不一 因此載入時間也不一定
所以導致最後結果 呈現 No 5 4 1 2 3 (每次都不一樣順序)
請問要如何才能固定圖片的順序 我想要的結果是 No 1 2 3 4 5
片段程式碼如下
for(j=1;j<=5;j++){
imageUrl=data_obj[j].name+".jpg";
var loadPic:Loader=new Loader();
loadPic.contentLoaderInfo.addEventListener(Event.COMPLETE
,function(e:Event):void{
var icon:Image=new Image();
icon.source=e.target.content;
addchild(icon);
});
loadPic.load(new URLRequest(imageUrl));
}