Note that there are some explanatory texts on larger screens.

plurals
  1. POActionScript 3.0 Error #1009: Cannot access a property or method of a null object reference
    text
    copied!<p>For my first project in flash I decided to make a little football game. It was working whenever I was identifying each individual object but then since I wanted to add more little AI players, I tried to make the movement work with some Arrays containing the objects but then it returned this error message. Any help?</p> <pre><code>function movers(event:Event):void { for (var qwerty:int=0;qwerty&lt;=(ALIEN.length);qwerty++) { var run:Object=ALIEN[qwerty]; run.rotation=Math.atan2(bc.y-run.y,bc.x-run.x)/(Math.PI/180); run.x+=Math.cos(sym.rotation*Math.PI/180)*SPD; run.y+=Math.sin(sym.rotation*Math.PI/180)*SPD; } if (ftblFLY) { ftbl.x+=Math.cos(ftbl.rotation*Math.PI/180)*7; ftbl.y+=Math.sin(ftbl.rotation*Math.PI/180)*7; } for (var wer:int=0;wer&lt;=(team.length);wer++) { if (ftbl.hitTestObject(wer)) { if (wer!=bc) { bc=wer; ftblFLY=false; } } } if (bc!=wr) { wr.x+=Math.cos(wr.rotation*Math.PI/180)*SPD; wr.y+=Math.sin(wr.rotation*Math.PI/180)*SPD; } for (var asdf:int=0;qwerty&lt;=(ALIEN.length);asdf++) { var runner:Object=ALIEN[asdf]; if (runner.hitTestObject(bc)) { stage.removeEventListener(Event.ENTER_FRAME,movers); stage.removeEventListener(KeyboardEvent.KEY_DOWN,keyers); stage.removeEventListener(MouseEvent.CLICK,clicko); texter.text="Tackled!!!"; } } bc.x+=Math.cos(bc.rotation*Math.PI/180)*(SPD*playaRD); bc.y+=Math.sin(bc.rotation*Math.PI/180)*(SPD*playaRD); bc.rotation=bc.rotation+(turno*playaTD); ftbl.rotation=bc.rotation; ftbl.x=bc.x; ftbl.y=bc.y; if (bc.y&lt;=0) { stage.removeEventListener(Event.ENTER_FRAME,movers); stage.removeEventListener(KeyboardEvent.KEY_DOWN,keyers); stage.removeEventListener(MouseEvent.CLICK,clicko); texter.text="Touchdown!!!"; } } </code></pre>
 

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