private var EnemyList:Array = new  Array();

       model5 = new Cube2( 1);
                       model5.material = modelMaterial2;
                       model5.z =100;
                       model5.y=50;
                       model5.x=0;
                       view.scene.addChild(model5);

                        EnemyList.push(model5)

2011/5/30 Stijn Stiefelhagen <[email protected]>

> 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);
>
>
>


-- 
Özgür Çimen
MM Developer & CG Arts
0090 535 766 33 14
http://www.cimenozgur.com/

Reply via email to