Note that there are some explanatory texts on larger screens.

plurals
  1. POI can play once my level and I can't do the other. Array
    primarykey
    data
    text
    <p>when I play the lvl1 my Array build normally, but if I want to do an other level after, nothing build. If I want to do an other level, even if I don't do the lvl1, only the first 5 column of my Array are build. And, to finish, when I finish the timer, I have this bug :</p> <pre><code>TypeError: Error #2007: Parameter hitTestObject must be non-null. at flash.display::DisplayObject/_hitTest() at flash.display::DisplayObject/hitTestObject() at projsolo_fla::MainTimeline/collisions()[projsolo_fla.MainTimeline::frame3:133] </code></pre> <p>this is my frame 1 code:</p> <pre><code>import flash.events.MouseEvent; //--- Variables: --- var toucheA: Boolean = false; var toucheZ: Boolean = false; var toucheE: Boolean = false; var toucheR: Boolean = false; var toucheT: Boolean = false; var map:Sprite=new Sprite(); //--- Ecouteurs: --- stage.addEventListener (KeyboardEvent.KEY_DOWN, pressee); stage.addEventListener (KeyboardEvent.KEY_UP, relachee); btnLevel.addEventListener (MouseEvent.CLICK, menuLevel); //--- autre: --- stop(); stage.displayState=StageDisplayState.FULL_SCREEN; stage.scaleMode=StageScaleMode.EXACT_FIT; stage.addEventListener (Event.ENTER_FRAME, moove); //--- Fonction: --- function pressee (e:KeyboardEvent):void{ switch (e.keyCode){ case 65 : toucheA=true; Pac.y=55; break; case 90 : toucheZ=true; Pac.y=105; break; case 69 : toucheE=true; Pac.y=155; break; case 82 : toucheR=true; Pac.y=205; break; case 84 : toucheT=true; Pac.y=255; break; default : break; } } function relachee (e:KeyboardEvent):void{ switch (e.keyCode){ case 65 : toucheA=false; break; case 90 : toucheZ=false; break; case 69 : toucheE=false; break; case 82 : toucheR=false; break; case 84 : toucheT=false; break; default : break; } } function moove (e:Event):void{ map.x-=5; } function menuLevel (e:MouseEvent):void{ gotoAndStop (2); } </code></pre> <p>this is my frame 2 code:</p> <pre><code>import flash.events.MouseEvent; btnMusique1.addEventListener (MouseEvent.CLICK, playLVL1); btnMusique2.addEventListener (MouseEvent.CLICK, playLVL2); btnMusique3.addEventListener (MouseEvent.CLICK, playLVL3); btnMusique4.addEventListener (MouseEvent.CLICK, playLVL4); function playLVL1 (e:MouseEvent):void{ gotoAndStop (3); lvl1 (); } function playLVL2 (e:MouseEvent):void{ gotoAndStop (3); lvl2(); } function playLVL3 (e:MouseEvent):void{ gotoAndStop (3); lvl3(); } function playLVL4 (e:MouseEvent):void{ gotoAndStop(3); lvl4(); } </code></pre> <p>this is my frame 3 code:</p> <pre><code>import flash.ui.Keyboard; import flash.events.Event; import flash.sampler.NewObjectSample; import flash.utils.Timer; import flash.events.TimerEvent; import flash.media.SoundChannel; import flashx.textLayout.formats.BlockProgression; //--- Variables: --- stop(); var timer1: Timer=new Timer (70000,1); var points: Number = 0; stage.addChild(map); var tableau1: Array=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,1,1,1,0,0,0,0,0,1,1,1,0,1,1,1,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,1,1,0,0,0,0,1,1,1,0,0,0,0,0,1,1,1,1,1,0,0,0,1,1,1,1,0,0,0,0,0,0,1,1,0,0,0,1,1,0,1,1,1,0,1,1,1,0,0,0,0,1,1], [0,0,0,0,1,1,1,0,0,0,1,1,1,0,0,0,1,1,1,0,0,0,1,1,1,0,0,0,1,1,1,0,0,0,1,1,1,0,0,0,1,1,1,0,0,0,1,1,1,0,0,0,1,1,1,0,0,0,1,1,1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,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,1]]; var L:int=0; var C:int=0; // création du tableau. function lvl1 () { for (L=0; L&lt;tableau1.length ;L++){ for(C=0; C&lt;tableau1[1].length ;C++){ if (tableau1[L][C]==1){ var Block: block=new block(); map.addChild(Block); Block.name="Block_"+L+"_"+C; Block.x=1620+C*60; Block.y=55+L*50; Block.addEventListener (Event.ENTER_FRAME, collisions); stage.removeEventListener (Event.ENTER_FRAME, lvl1); } } } } function lvl2 () { for (L=0; L&lt;tableau2.length;L++){ for(C=0; C&lt;tableau2.length;C++){ if (tableau2[L][C]==1){ var Block: block=new block(); map.addChild(Block); Block.name="Block_"+L+"_"+C; Block.x=1620+C*60; Block.y=55+L*50; Block.addEventListener (Event.ENTER_FRAME, collisions); stage.removeEventListener (Event.ENTER_FRAME, lvl2); } } } } function lvl3 () { for (L=0; L&lt;tableau3.length;L++){ for(C=0; C&lt;tableau3.length;C++){ if (tableau3[L][C]==1){ var Block: block=new block(); map.addChild(Block); Block.name="Block_"+L+"_"+C; Block.x=1620+C*60; Block.y=55+L*50; Block.addEventListener (Event.ENTER_FRAME, collisions); stage.removeEventListener (Event.ENTER_FRAME, lvl3); } } } } function lvl4 () { for (L=0; L&lt;tableau4.length;L++){ for(C=0; C&lt;tableau4.length;C++){ if (tableau4[L][C]==1){ var Block: block=new block(); map.addChild(Block); Block.name="Block_"+L+"_"+C; Block.x=1620+C*60; Block.y=55+L*50; Block.addEventListener (Event.ENTER_FRAME, collisions); stage.removeEventListener (Event.ENTER_FRAME, lvl4); } } } } //--- Ecouteurs: --- timer1.addEventListener (TimerEvent.TIMER, stoplvl1); timer1.start(); //--- Fonctions: --- function stoplvl1 (e:TimerEvent) :void{ stage.removeEventListener(Event.ENTER_FRAME, moove); for (L=0; L&lt;tableau1.length ;L++){ for(C=0; C&lt;tableau1[1].length ;C++){ if (tableau1[L][C]==1){ tableau1[L][C]=0; } } } stage.removeChild(map); gotoAndStop(4); } function collisions (e:Event):void { if(e.target.hitTestObject(Pac)){ for (L=0; L&lt;tableau1.length ;L++){ for(C=0; C&lt;tableau1[1].length ;C++){ if (tableau1[L][C]==1){ tableau1[L][C]=0; } } } e.target.nextFrame(); e.target.removeEventListener(Event.ENTER_FRAME, collisions); points+=1000; Scorelvl.text = points.toString(); } } </code></pre> <p>and this is my frame 4 code:</p> <pre><code>import flash.events.MouseEvent; ScoreFin.text = points.toString(); btnMenu.addEventListener (MouseEvent.CLICK, retourMenu); function retourMenu (e:MouseEvent):void{ gotoAndStop(2); } </code></pre> <p><strong>EDIT</strong> As per OP's comment:</p> <p>I have my different levels (<code>LVL2</code>,<code>LVL3</code>,<code>LVL4</code>) that is not correctly initialized when I execute my function <code>lvl2</code>, <code>lvl3</code>, <code>lvl4</code> in the loop ranging from <code>frame 3</code> from <code>line 64 to 110</code>. </p> <p>Instead of creating the array this creates only the first five columns, and not the rest.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload