KunoNoOni

weird error

Apr 13th, 2013
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. in one class I have these 2 functions
  2.  
  3. private function initPlayerBullets():void
  4. {
  5. for(var v:int = 0;v<20;v++)
  6. {
  7. b = new Bullet(-20,-20);
  8. bulletGroup.add(b);
  9. }
  10.  
  11. Hero.bulletArray = bulletGroup.members;
  12. add(bulletGroup);
  13. }
  14.  
  15. private function initEnemyBullets():void
  16. {
  17. for(var v:int = 0;v<20;v++)
  18. {
  19. b = new Bullet(-60,-60);
  20. eBulletGroup.add(b);
  21. }
  22.  
  23. eUFO.eBullet = eBulletGroup.members;
  24. add(eBulletGroup);
  25.  
  26.  
  27. Hero is an instance of the Player class
  28. eUFO is an instance of the Ufo class
  29.  
  30.  
  31.  
  32. In the Player class I have this 'public var bulletArray:Array;'
  33. in the Ufo class I have this 'public var eBullet:Array;'
  34.  
  35. The error I get is with this line 'eUFO.eBullet = eBulletGroup.members;', specifically with this part of that line 'eUFO.eBullet'
  36.  
  37. 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;'
  38.  
  39. If I had hair I'd be pulling it out right now! LOL!
Advertisement
Add Comment
Please, Sign In to add comment