proplem in in using load with enterframe event in flash & actionscript3

17 views Asked by At

hi iam new in action script3 when i use loader outside EnterFrame function the code run corctly without this line

num= new Loader; when i use this line the last show image under it when i run code inside enterframehandler function no img apear[[enter image description here]

(https://i.stack.imgur.com/5lkCF.png)] (https://i.stack.imgur.com/WoD2B.png)


`var startGame:Boolean=true;`
var num:Loader= new Loader;
player.addEventListener(Event.ENTER_FRAME, fl_EnterFrameHandler5);
function fl_EnterFrameHandler5(event:Event):void{
    if(startGame){
    
num.load(new URLRequest("flappy-bird-assets-master/sprites/0.png"));
box.addChild(num);
num.load(new URLRequest("flappy-bird-assets-master/sprites/1.png"));
box.addChild(num);
num.load(new URLRequest("flappy-bird-assets-master/sprites/2.png"));
box.addChild(num);
num.load(new URLRequest("flappy-bird-assets-master/sprites/3.png"));
box.addChild(num);
num.load(new URLRequest("flappy-bird-assets-master/sprites/4.png"));
box.addChild(num);
num= new Loader;
num.load(new URLRequest("flappy-bird-assets-master/sprites/1.png"));
box.addChild(num);num= new Loader;
}}

i try evry thig but cant solve this proplem

0

There are 0 answers