Run Function on enter frame
When I use the following code:
addEventListener(Event.ENTER_FRAME, ImportantFunction);
function ImportantFunction(event:Event):void // Main Function
{
//Function in here
}
I get the following error.
TypeError: Error #1009: Cannot access a property or method of a null object reference.
The program still works but the error concerns me. I can call the same function using a button click or object change with no problems.
What am I doing wrong?
