2 Replies Latest reply on Feb 28, 2007 2:49 PM by SymTsb

    Attaching Problem

    Tyler1128
      I am trying to attach many instances of a MovieClip to an array so when the mouse is pressed it puts the image on the stage and "fires" it in a line to the ground. It goes into the array fine but also attaches one at (0, 0) making it run slower and slower. I need a way to attach an instance and not have it go onto the stage but go into the array.
      The code is
        • 1. Re: Attaching Problem
          kglad Adobe Community Professional & MVP
          what you want makes no sense: you want to create an instance but not create an instance.

          what you stated, you could have: you want to create an instance but not have it on-stage.

          that's easy. change its _x and _y properties so it's not on-stage or change its _visible property to zero. but that will still slow your swf (if you're creating many of those movieclips). so, that's probably not what you want.

          so, what is it that you need? what purpose is served to create shot movieclips before they are needed?
          • 2. Re: Attaching Problem
            SymTsb Level 2
            If this is meant only as a reference, only store the future name of the object in the array. You can dynamically generate the names easy. Store that data to the array and don't attachMovie at all. When you need to run attachMovie, you can cycle through the array later and attach them later as needed. Is this for a game? I'd not recommend putting 2000 of anything on the screen at one time. Flash Player's performance will be hosed.