Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- in one class I have these 2 functions
- private function initPlayerBullets():void
- {
- for(var v:int = 0;v<20;v++)
- {
- b = new Bullet(-20,-20);
- bulletGroup.add(b);
- }
- Hero.bulletArray = bulletGroup.members;
- add(bulletGroup);
- }
- private function initEnemyBullets():void
- {
- for(var v:int = 0;v<20;v++)
- {
- b = new Bullet(-60,-60);
- eBulletGroup.add(b);
- }
- eUFO.eBullet = eBulletGroup.members;
- add(eBulletGroup);
- Hero is an instance of the Player class
- eUFO is an instance of the Ufo class
- In the Player class I have this 'public var bulletArray:Array;'
- in the Ufo class I have this 'public var eBullet:Array;'
- The error I get is with this line 'eUFO.eBullet = eBulletGroup.members;', specifically with this part of that line 'eUFO.eBullet'
- All this line is doing is making a copy of what is in eBulletGroup.members and putting it into eUFO.eBullet. This line does the same this and I don't get an error with it 'Hero.bulletArray = bulletGroup.members;'
- If I had hair I'd be pulling it out right now! LOL!
Advertisement
Add Comment
Please, Sign In to add comment