This content has been marked as final. Show 5 replies
don't execute removeChild() until your movieclip's alpha is zero.
Yes, I know. But how do I get removeChild() to "wait" until the alpha is zero?
I can't just insert an "if" statement to check the alpha before running removeChild() because it will immediately execute, find the alpha is not 0, and therefore won't execute the removeChild().
If I try to add the removeChild to the fadeOut() method inside the class so that it executes once the alpha reaches 0, I get the following error:
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
I'm wondering how to code this? Do I need to setup another onEnterFrame listener that checks myMovieClip.alpha or some type of timer function that does the same thing. That would seem like an overly complex way to solve what seems like a simple problem, but maybe that is the only way.
it should be in your class within your fadeOut() method and remove it from your myMovieClip instance's parent.
That's it! Thanks!
What I needed to call was "parent.removeChild(this);" from inside the fadeOut() method.