create, unload and create again.

  • sara.s
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Apr 21, 2007
  • Posts: 13
  • Status: Offline

Post September 11th, 2007, 4:27 am

hi every body :)

I have a little problem with my movies, I create an empty movieClip and then I load a pic into it, when an event occur I want to unload or remove my movie and then create it again with the same instance name, but it doesn't create it again..

can you help me?
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post September 11th, 2007, 4:27 am

  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Joined: Jul 11, 2005
  • Posts: 1828
  • Loc: In the Great White North
  • Status: Offline

Post September 11th, 2007, 9:58 pm

are you sure its being removed completely?

Code: [ Select ]
if(path.MovieClipName != undefined){
removeMovieClip(path.MovieClipName);
}

trace(path.MovieClipName);
  1. if(path.MovieClipName != undefined){
  2. removeMovieClip(path.MovieClipName);
  3. }
  4. trace(path.MovieClipName);
  • sara.s
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Apr 21, 2007
  • Posts: 13
  • Status: Offline

Post September 11th, 2007, 11:01 pm

well, with this code I can see that when I use removeMovieClip the movie doesn't remove, but when I use unloadMovie the movie goes for ever..

why do you think?
what can I do to remove the movie completely ?
  • sara.s
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Apr 21, 2007
  • Posts: 13
  • Status: Offline

Post September 11th, 2007, 11:14 pm

you know, the if is true and the code goes in to it, I place a trace in it. but why the movie is still there?
  • sara.s
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Apr 21, 2007
  • Posts: 13
  • Status: Offline

Post September 11th, 2007, 11:53 pm

horaaaaaaa

I find it :D
Any movie clip with a depth between 0 and 1048575 inclusive can be programmatically removed. Any other movie clip remains unaffected by removeMovieClip( ).
As you may have already noticed, when you create movie clips using getNextHighestDepth( ), they are generally assigned depths greater than 1048575. That means you cannot remove them using a conventional removeMovieClip( ) method call. However, you can still remove them. The key is that you need to change the depth to be within the valid range. You can accomplish that using swapDepths( ). For example, you can use the following to remove mClip even if its original depth was not in the valid range.

mClip.swapDepths(0);
mClip.removeMovieClip();
  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Joined: Jul 11, 2005
  • Posts: 1828
  • Loc: In the Great White North
  • Status: Offline

Post September 12th, 2007, 6:08 am

strange. I don't think i've ever had that problem with getNextHighestDepth

Post Information

  • Total Posts in this topic: 6 posts
  • Users browsing this forum: No registered users and 40 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.