How to fix closure problem in ActionScript 3 (AS3)

前端 未结 4 810
Happy的楠姐
Happy的楠姐 2020-12-01 06:31

In the code below I\'m trying to load some images and put them in the stage as soon as they get individually loaded. But it is bugged since only the last image is displayed.

4条回答
  •  时光说笑
    2020-12-01 07:02

    (function() {
      var imageData = imageList[i];
      imageData.loader.contentLoaderInfo.addEventListener(Event.COMPLETE, function() {
        // use imageData;
      });
    }).apply();
    

提交回复
热议问题