Shouldn't you create an Array before accessing it? private var EnemyList:Array = new Array();
-- Apprentice On Mon, May 30, 2011 at 1:57 PM, andrew barry <[email protected]> wrote: > > i cant simply add a model to an array ? > > private var EnemyList:Array; > > model5 = new Cube2( 1); > model5.material = modelMaterial2; > model5.z =100; > model5.y=50; > model5.x=0; > view.scene.addChild(model5); > > EnemyList.push(model5); //error as Cannot access a > property or > method of a null object reference. > model5.addEventListener("enemyLoaded",en_Handler);
