2 Replies Latest reply on Jan 12, 2010 1:06 PM by Ned Murphy

    very quick one...

    andib311

      Can someone please take a very quick look at this section of code and tell me why it's not working:

       

       

      if (last_action._currentframe > 90) {
      
      advance_mc._visible = true;
      }
      else {
       advance_mc._visible = false;
      }

       

      I quite literally want the movieclip "advance_mc" (on the root level) to be invisible until the movieclip "last_action" (also on the root level) has progressed beyond its 90th frame.

      Presently, "advance_mc" does not appear at all.

       

      Any help would be greatful.

       

      Thanks

        • 1. Re: very quick one...
          DazFaz Level 1

          My first question is "how are you checking the if statement?

           

          I mean is this within a addListener, onenterframe function, watch etc?

          • 2. Re: very quick one...
            Ned Murphy Adobe Community Professional & MVP

            If that is the only code you have working to achieve the desired result, you'll be coming up short.  In general, codes either sits waiting to execute (functions) or executes as soon as it comes up and is done (what you show).  What you need is to have that code continuously being called, which you can do using enterframe coding.  Place the following in the _root timeline...

             

            this.onEnterFrame = function(){

                 if (last_action._currentframe > 90) {

                      advance_mc._visible = true;
                 }  else {
                      advance_mc._visible = false;

                      delete this.onEnterFrame; // remove it unless you'll be moving back to <= 90
                 }

            }

            1 person found this helpful