Hi Eric,

i often got the same problem, which I usually resolve with these basic rules :

- when creating MCs inside a loop, first create an empty movieClip before the loop to contain the other clips : var containerMc:MovieClip = _root.createEmptyMovieClip ("containerMc", 10);
                for (var i=0;i<3;i++)
                {
                        var clip:MovieClip = containerMc.attachMovie(....)
                }
then, when you need to remove them, juste invoke containerMc.removeMovieClip();

- do not use getNextHighestDepth()

- keep on _root a manageable array of attached MCs

- do not attach on _root.

The weird thing is, using your script on an almost empty movie, the removeMovieClip method works allright... maybe you can try using _level0 instead of _root, or try the container trick above.

Hope this helps,


Gilles

Le 17 avr. 07 à 15:49, eric e. dolecki a écrit :

It seems that I might have a timing problem... I am running very large
(1920x1080) and I guess its taking quite a while to destroy the clips. I've made some workarounds, but there is still a clip I cannot seem to destroy
here. Fun stuff :/

On 4/17/07, Norman Cousineau <[EMAIL PROTECTED]> wrote:

I had the same problem. In my case, the code was in a class the did not
extend MovieClip.  Extending it fixed the problem.  Other people have
suggested using the DepthManager class, but that did not work for me.

-----Original Message-----
From: eric e. dolecki [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 17, 2007 8:53 AM
To: Flashcoders mailing list
Subject: [Flashcoders] Weird removeMovieClip problem


Flash Player 9 r45 executable
AS2

I am attaching 3 movieclips, then later need to remove them. No dice. This
seems SO noob, but its not happening:

for( var i=0; i<3; i++)
{
var clip:MovieClip = _root.attachMovie( "object_3D", "object_3D_" + i,
i+40 );
   // other normal stuff
}

then later I run this function:

killCamera = function():Void
{
    for( var i=0; i<3; i++ )
    {
_root["object_3D_"+i].removeMovieClip(); //Does nothing... clips
remain
    }

    // Hmm... lets try this & make sure they are really there:
    for (prop in _root)
    {
        if( typeof( _root[prop] ) == "movieclip" )
        {
            if( _root[prop]._name.indexOf("object_3D") != -1 )
            {
                trace( _root[prop]._name );          // traces the
instance
name just fine...
                _root[prop].removeMovieClip();  // Does nothing...
            }
        }
    }
};

These freaking clips stick around for some reason. ???


_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com




--
eric e. dolecki
senior interactive engineer
http://www.ericd.net
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to