|
|
|
#1 | |
|
Member
Join Date: Dec 2006
Posts: 45
|
[F8] removeMovieClip() in this script isn't working
I have absolutely no idea why the following code isn't working. I've checked the documentation for removeMovieClip at least a dozen times. The only thing I've noticed is the following:
Quote:
Here is my code. When I trace white in the onRollOut function, it returns the correct path, so it's not a targetting issue. I've also tried adjusting one of the movieclip white's properties (alpha) and it's worked fine. Code:
planet.onRollOver = function(){
var over:MovieClip = createEmptyMovieClip("white",this.getDepth()-1);
//other events
}
planet.onRollOut = function(){
white.removeMovieClip(); //trace here returns proper path
}
__________________
Using: Flash Professional 8 | Flash Player 8/9 | Actionscript 2 | PHP 5.1.6 | MySQL 5.0 | Latest Helpful Links: XML Dropdown Menu - How To Use Fusekit |
|
|
|
|
|
|
#2 |
|
Flashmatics
Join Date: Mar 2005
Location: London, UK
Posts: 4,813
|
removeMovieClip() can remove ANY movie clip as long as the depth of the movie clip is POSITIVE AND LESS THAN 1,048,575
Movieclips that are made during author time can hence be removed by first making them positive and then using the removeClipMethod() Hence ANY movieclip mcHolder (dynamic or authortime) can be removed mcHolder.swapDepths(_root.getNextHighestDepth()): mcHolder.removeMovieClip(); However if you use components sometimes elements are placed at a depth greater than 1,048,575, hence it cant be removed unless you lower the depth. So check the depth of the movieclip and if its higher than 1,048,575 first lower it to a lower depth and then try rmeoving it. so basically u can use something like: Code:
if(mcHolder.getDepth() >= 1048575 || mcHolder.getDepth() <= 0 ){
mcHolder.swapDepths(2000);
}
mcHolder.removeMovieClip();
__________________
Flashmatics | Flashmatics Library (free downloads) ----------------------------------------------------- Latest Projects: The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience ----------------------------------------------------- Flash Certified Developer |
|
|
|
|
|
#3 |
|
Member
Join Date: Dec 2006
Posts: 45
|
Hey, silentweed.
Thanks for that information. May I ask where you found it? It wasn't in any of documentation I read.
__________________
Using: Flash Professional 8 | Flash Player 8/9 | Actionscript 2 | PHP 5.1.6 | MySQL 5.0 | Latest Helpful Links: XML Dropdown Menu - How To Use Fusekit |
|
|
|
|
|
#4 |
|
Junior Member
Join Date: Nov 2001
Posts: 6
|
Silentweed, I know this is a couple of years after the fact - just wanted to say thanks for posting that solution; it worked like a charm and saved me a lot of grief. Thanks again!
|
|
|
|
![]() |
|
||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|