so to start off heres the exact error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
and my code:
import flash.events.Event;
import flash.utils.Timer;
import flash.events.TimerEvent
var gameTimer:Timer;
addEventListener(Event.ENTER_FRAME,downspike)
function downspike(e:Event):void{
function downspike( timerEvent:TimerEvent ):void{
gameTimer = new Timer(25)
gameTimer.addEventListener(TimerEvent.TIMER, downspike)
gameTimer.start()
}
Spike.x=218;
Spike.y=0;
y=y+10
Player.x=mouseX;
Player.y=mouseY;
if(Player.hitTestObject(Spike) )
{
gameTimer.stop()
}
}
so i know my code is super sloppy. i started of thinking i was going code it all on my own then i ended up needing help and stupidly tried to add stuff from a tutorial.
i probaly should just erase the stuff from the tutorial and attempt it myself. but im at a lose anyway... so with my code i have a spike coming down and a ball that follows my mouse and i was hoping that when the two hit it would be a crude game over type thing but it would really just freeze. but rather it gave me that error. so anybody who feels up to helping me can choose one of two options. either help me try and fix this coding. or suggest a better way to make it well the spike hits the ball its a sense of game over