KingBling
11-20-2005, 05:38 PM
Hi,
I have come accross some strange behaviour using removeMovieClip()...
Can someone please confirm this behaviour, or better yet, offer an explanation or solution to this...
In a new Flash document, I put this code in the first frame, which works fine:
// `````````````````````````````````````````````````` ``````
stop();
_root.attachMovie("myClip", "myClip_mc", this.getNextHighestDepth());
myClip_mc.onPress = function(){
trace(this.getDepth()); // output: 0
removeMovieClip(this);
}
// `````````````````````````````````````````````````` ``````
Now, I drag a UI component into my library, say a button component. When I test the movie now, the removeMovieClip no longer works. Also note the output of the .getDepth() trace...
// `````````````````````````````````````````````````` ``````
stop();
_root.attachMovie("myClip", "myClip_mc", this.getNextHighestDepth());
myClip_mc.onPress = function(){
trace(this.getDepth()); // output: 1048576
removeMovieClip(this);
}
// `````````````````````````````````````````````````` ``````
Can anyone help out here? How would I go about removing this movieclip?
:confused:
Thx
I have come accross some strange behaviour using removeMovieClip()...
Can someone please confirm this behaviour, or better yet, offer an explanation or solution to this...
In a new Flash document, I put this code in the first frame, which works fine:
// `````````````````````````````````````````````````` ``````
stop();
_root.attachMovie("myClip", "myClip_mc", this.getNextHighestDepth());
myClip_mc.onPress = function(){
trace(this.getDepth()); // output: 0
removeMovieClip(this);
}
// `````````````````````````````````````````````````` ``````
Now, I drag a UI component into my library, say a button component. When I test the movie now, the removeMovieClip no longer works. Also note the output of the .getDepth() trace...
// `````````````````````````````````````````````````` ``````
stop();
_root.attachMovie("myClip", "myClip_mc", this.getNextHighestDepth());
myClip_mc.onPress = function(){
trace(this.getDepth()); // output: 1048576
removeMovieClip(this);
}
// `````````````````````````````````````````````````` ``````
Can anyone help out here? How would I go about removing this movieclip?
:confused:
Thx