5 Replies Latest reply on Aug 9, 2006 9:26 PM by Bahaar

    Another removeMovieClip question

    Bahaar
      I do apologize if this has been answered. I did a search but none seemed to answer my question or be intelligible to me.

      In my movie, I start with one small movie clip that begins at _alpha = 0. On the enterFrame, I have alpha increase by 10. When the alpha hits 100, I have it do two things:

      1 : It uses attachMovie() to pull a symbol from the library onto the stage. It places the new instance on _root, so that the new instance is not a child of the movieClip itself. (By the way, the symbol that it pulls out is itself. But I don't want to use duplicateMovieClip() ).

      2 : The movieClip then begins to fade the _alpah back out to 0. Once it gets to 0 or lower it is supposed to remove itself from the stage. I've tried: removeMovieClip(this), and _root.removeMovieClip(this), and this.removeClipClip(this) and a bunch of other variations on the theme.

      The problem is that the clip isn't removing itself. I put in a trace to see if it was getting to that area and at the right time, it was reporting trace(_name + " killing itself.") . I'm not *really* good at using the debugger, but when I tried, I noticed that I could click a clip that was *supposed* to be gone and it listed the clip's _alpha property as -4938.34 and decreasing! So, it seems that although it's hitting the code at the right time the clip isn't removing itself. Intrestingly, I don't get repeats of my self-destruct message---even though the clip still seems to be on the stage...even though it should be gone.

      What gives? Any idea?

      ---Damian
        • 1. Re: Another removeMovieClip question
          everynewday
          "yourMovieClipName.removeMovieClip();" is the correct syntax, I believe. If that doesn't work, try "_root[yourMovieClipName].removeMovieClip();". Hope that helps.
          • 2. Re: Another removeMovieClip question
            Rothrock Level 5
            The correct syntax would be:

            this.removeMovieClip();

            If the scope is the clip you want to remove. And if the code is inside an onEnterFrame function that is defined something like:

            myClip.onEnterFrame=function()

            then that would be the correct syntax.

            Of course how you use the code to decide that the clip should be removed could be the problem. If you have something like

            if(this._alpha==10)

            You might be surprised that it never actually hits 10. Try it. You can't set an _alpha of 10. (Okay, you can set it, but the value won't be 10!)

            So if you aren't already, try using an inequality.

            if(this._alpha<10)

            or whatever values you need.
            • 3. Re: Another removeMovieClip question
              Rothrock Level 5
              Oh I just thought of one other thing. Are you using components? And when you attachMovie() are you using getNextHighestDepth()?

              If you are, then stop that!
              • 4. Re: Another removeMovieClip question
                kglad Adobe Community Professional & MVP
                lol, rothrock. i think i'm going to refer to this issue as the 1048575+ issue.
                • 5. Re: Another removeMovieClip question
                  Bahaar Level 1
                  Thanks for all the help. Interestingly, it's still a no-go.

                  I don't use getNextHighestDepth. Instead, I use a _root.CurrLevel which I increment and manage on my own. I do catch the alpha by using if(this._alpha <= 0)

                  The script is in an .as file so, I guess essentially, the script is "on" the movieClip itself. I've tried all sorts of variations on the removeMovieClip configuration.

                  Interestingly, I have other similar movies that use the same logic and those clips vanish just fine. <boggle>