Be a Supporter!

removemovieclip woes

  • 265 Views
  • 4 Replies
New Topic Respond to this Topic
Xyresic
Xyresic
  • Member since: Dec. 15, 2006
  • Offline.
Forum Stats
Member
Level 19
Musician
removemovieclip woes 2009-10-25 06:57:15 Reply

I'm having some problems trying to remove a loading bar from the screen. My code clearly says _root.removeMovieClip(loadbar) but nothing's happening. I've tried all these variations like removeMovieClip(_root.loadbar). I've created a tween function which will move a movieclip to any part of the stage with a slight ease out (i don't want to use inbuilt tweens cause it will clog everything up), and the removeMovieClip function is supposed to trigger at the end, ie, when the loadbar is off screen. I won't post the code because i doubt it will solve anything, it works fine on another movieclip just not the loadbar. tell me if you need more info... please help.
P.S I just tried deleting directly without being cued by the tween function, but that isn't working either

LONG STORY SHORT: Trying to remove a movieclip with removeMovieClip function, tried every variation, nothing working, why is this MC invincible?


bork bork bork

Havegum
Havegum
  • Member since: Oct. 20, 2008
  • Offline.
Forum Stats
Supporter
Level 24
Melancholy
Response to removemovieclip woes 2009-10-25 07:05:01 Reply

At 10/25/09 06:57 AM, crapatflash wrote: Why is this MC invincible?

Cause Flash is evilz!!

Anywayz, I remember having some troubles with removeMovieClip() myself, but i think that you have to use something like this:

_root.victim._removeMovieClip();
trace("Mwahahahahaha!!")

BBS Signature
Fion
Fion
  • Member since: Aug. 21, 2005
  • Offline.
Forum Stats
Member
Level 39
Blank Slate
Response to removemovieclip woes 2009-10-25 07:06:01 Reply

removeMovieClip() only works on a clip that has a positive depth, so if you have drawn said movieclip in the flash environment on the stage before exporting your movie (i.e. it hasn't been attached using code) it will not have a positive depth and will not be removed. Put this line before the remove line:

_root.loadbar.swapDepths(_root.getNextHighestDepth);

.

BBS Signature
Fion
Fion
  • Member since: Aug. 21, 2005
  • Offline.
Forum Stats
Member
Level 39
Blank Slate
Response to removemovieclip woes 2009-10-25 07:09:09 Reply

Hold on, let me try that again, use this code:

_root.loadbar.swapDepths(_root.getNextHighestDepth());
_root.loadbar.removeMovieClip(this);

.

BBS Signature
Xyresic
Xyresic
  • Member since: Dec. 15, 2006
  • Offline.
Forum Stats
Member
Level 19
Musician
Response to removemovieclip woes 2009-10-26 03:53:03 Reply

At 10/25/09 07:09 AM, Fion wrote: Hold on, let me try that again, use this code:

_root.loadbar.swapDepths(_root.getNextHi ghestDepth());
_root.loadbar.removeMovieClip(this);

Thanks! worked like a charm.


bork bork bork