3 Replies Latest reply on Nov 4, 2006 11:25 PM by kglad

    Deleting or Hiding an Array

    bashbro2
      Hello all and thank you for any help that is given,

      I have been working on this a long time and can not get it for the life of me. Basically I am creating the game Kaboom for a class and I have many different game states (load, gameinit, gameplay, gamewin, gameover). During gameplay, dynamic movieclips and arrays are called and show up in the game, however when I reach the point when the game should switch to gamewin or gameover, the arrays still show. I can get all the movieclips to disappear by either removemovieclip or hide, but the arrays show up and it is not acceptable. Is there any way to remove, delete, or hide the array totally so that it does not show up in the different game states?

      Thank you very much!
        • 1. Re: Deleting or Hiding an Array
          kglad Adobe Community Professional & MVP
          what causes the array to be displayed?
          • 2. Re: Deleting or Hiding an Array
            bashbro2 Level 1
            I have this code in a class that basically starts everything, the two arrays, movieclips ect. The problem lies in the fact that when I call the gameover or gamewin class, the arrays carry over into them and never stop until I start the game all over again. Thank you for your help

            function initGameGraphics()
            {
            Mouse.hide();
            mcBackGround = _root.attachMovie("background", "background_mc", -10, {_x:0, _y:90});
            mcGameUIPanel = _root.attachMovie("GameUIPanel", "gameui_mc", 4000, {_x:0, _y:0, lives:currLives, score:currScore});
            mcBurglar = _root.attachMovie("Burglar", "burglar_mc", _root.getNextHighestDepth(),{_x:0, _y:0});
            mcFloor = _root.attachMovie("floor", "floor_mc", 25, {_x:250, _y:400});
            for (var counter:Number = 0; counter < maxbombs; counter++)
            {
            mcBombArray.push(_root.attachMovie("Bomb","bomb"+counter+"_mc", counter + 200, {myManager:this}));
            }
            for(var playercounter:Number = 1; playercounter <= currLives; playercounter++)
            {
            mcPlayerArray.push(_root.attachMovie("Player", "player"+playercounter+"_mc", playercounter, {_x:0, _y:playerheight}));
            playerheight -= 40;
            }
            }
            • 3. Re: Deleting or Hiding an Array
              kglad Adobe Community Professional & MVP
              try: