Under rating threshold (hideshow)
I get the output error:
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display::DisplayObjectContainer/removeChild()
at EnemyShip/kill()
at EnemyShip/enterFrame()
when the enemyships are out of range (when they are supposed to be removed from the stage). How do i fix this?
Under rating threshold (hideshow)
function enterFrame(e:Event){
this.x += speed;
if (this.x > 600){
removeEventListener(Event.ENTER_FRAME, enterFrame);
stage.removeChild(this);
return;
}
for (var i in EnemyShip.list){
if (this.hitTestObject(EnemyShip.list[i])){
removeEventListener(Event.ENTER_FRAME, enterFrame);
stage.removeChild(this);
EnemyShip.list[i].kill();
break;
}
if we say removeEventListener() why must we say return? Surely once the event listener is removed the entire function becomes inoperative? Could someone please explain what happens once an event listener is remove. I thought it automatically exists the function.
Under rating threshold (hideshow)
I'm getting an Error #2007: Parameter hitTestObject must be non-null... but my code is exact the same as the examples... someone can help?
Under rating threshold (hideshow)
To get the explosion movie clip, you need to extract the Untitled-1.fla, open it, copy the explosion movie clip from the library, then paste it onto the stage of your game.
Under rating threshold (hideshow)
You messed up making the interval number. To make it between 500 and 1500, you do Math.random()*1000 +500, not Math.random()*500 +1000.
Under rating threshold (hideshow)
@Kamet: I would guess that means when you type "...hitTest([something])" the something is not a valid reference to an instance.
Under rating threshold (hideshow)
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at Explosion/enterFrame()
I get it every time :(
Under rating threshold (hideshow)
Every thing is working accept my bullet isn't colliding with the enemy ship it just goes right through them. :( Does any one know why maybe? I have no errors & Im to page 12.
Under rating threshold (hideshow)
Okay, problem in step 13. I don't understand what am I supposed to do with that code you put there. But, until that, great tutorial. 5/5
Under rating threshold (hideshow)
Neosano... don't blame Moly, blame Adobe for the method name. Also, who says push relates to that... why not to pushing a shoppting cart down the isle, or whatnot.
Under rating threshold (hideshow)
Not a KILL function! It must be called DIE... And only the Game class can call a death...
And again coordinates porn... keep all the coordinates in the constructor!
Page 8 - more porn!
statics... guy, you're random! What for????
Omg... This list must be created in the Game! And all hit test go to the game!
Page 10 - list.remove(this) instead of this porn.
What about creating a one class BULLET instead of this two? The code will be smaller.
Under rating threshold (hideshow)
I'm not sure what part of the sentence "Made with permission from Kongregate" you guys don't understand... If it is true then this is Ok... can someone from Kong clear it up... anyways update was needed to AS3.