This content has been marked as final. Show 6 replies
I always have a problem with this, but eventually find the right object to address. Since you attached the movie to blip, try:
If that doesn't work, pick newName and give that a shot.
If that doesn't work, then try using a _parent reference. It kinda depends on where "this" is relative to the rest of what you're dealing with.
If someone else does have a firm grip on this, then by all means, ring in.
It is a most likely a scoping issue and a case of how removeMovieClip() works. It will only work on clips that are dynamically created by code, so is waBlip_mc dynamically created or is it runtime created?
Because that is the movie you are trying to remove. Inside the event handler "this" refers to the object you have attached the event handler to. So is that right, or are you trying to remove waPopup_mc?
Finally the next problem might be one of depths. If you are using any components your this.getNextHighestDepth() might be returning a really high deapth (1048575 or above) that won't allow dynamically created clips to be removed.
I also see a problem with that depth assignment in that the scope of your function most likely isn't what you think it is. Inside the onRollOver event handler function your scope is the item that the handler is attached to, i.e. waBlip_mc. You can see that by adding a trace:
trace("Current scope is: "+this);
But once the handler calls another function, in this case showPup(), the scope changes to where that function is defined. So if you add a trace inside that function you will get a different scope, most likely _level0 or whatever timeline all this code is defined on.
So I'm not exactly sure, but some combination of those things is most likely the problem.
I've tried all of these. This is driving me nutz. I can't figure it out. Grrrr!
I got it! Look below to see what I did. Thanks to everyone that helped out on this.
What do you mean you've tried all of these? So what depth are you assigning them too?
Do you use any components in your movie?
That causes the getNextHighestDepth() function to return really high depth values, that are out of range for the removeMovieClip() function to remove.
You should use the DepthManager component in this case. Just look it up in the help files of Flash.
As a workaround, if you don't want to use the DepthManager, you can do a swapDepths() on the clip and swap it to a layer that is in range.