TypeError: Error #1009: Cannot access a property or method of a null object reference.
I'm having some real difficulty here.
I've been trying to push a random number into an array, but have slammed into this absolute weird error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at memory_v02_fla::MainTimeline/light()[file_fla.MainTimeline::frame1:15]
at memory_v02_fla::MainTimeline/startGame()[file_fla.MainTimeline::frame1:21]
at memory_v02_fla::MainTimeline/memory_v02_fla::frame1()[file_fla.MainTimeline::frame1:24]
I have no idea what this is, and what I can do to solve it. Does anybody have any idea? Here's my proceeding code.
Code:
// Import Tweener
import caurina.transitions.Tweener;
import caurina.transitions.properties.ColorShortcuts;
ColorShortcuts.init();
var aPieces:Array = [m1,m2,m3,m4];
var aMoveList:Array;
function light(num){
Tweener.addTween(aPieces[num], {_brightness:2, time:1});
Tweener.addTween(aPieces[num], {_brightness:0, time:1, delay:1});
//This next line is responsible for the error
aMoveList.push(num);
}
function startGame(){
var first:Number = Math.floor(Math.random()*4);
light(first);
}
startGame();