2 Replies Latest reply on Nov 25, 2010 10:03 AM by gaminflash

    Movieclip keyframe

    gaminflash Level 1

      Hi, i have another question about the movieclip. This time you'll maybe understand it a little bit more .


      Can you make a script where you can make a thing go true if it enters a certain frame in a movieclip? Like this or something:


      onEnterFrame = function(){


      if(Key.isDown(Key.UP) && mc.frame(10) == true){

      some actions.



      Is there any way that this may be possible?

        • 1. Re: Movieclip keyframe
          Ned Murphy Adobe Community Professional & MVP

          You do not want to use an enterframe for anything unless the intention is to have something execute repeatedly... the name given to it does not reflect its functionality.  It might be useful in this case if you don't intend to place the code inside the movieclip.


          If you want something to happen when a movieclip enters a specific frame, then you can just put that assignment code in the frame within the movieclip... nothing else needed...


          thing = true;


          If the code is not going to be within that movieclip, then you would use an enterframe because you need to continuously check where that movieclip is in its timeline...


          mc.onEnterFrame = function(){

               if(mc._currentframe == someframe){

                    thing = true;



          • 2. Re: Movieclip keyframe
            gaminflash Level 1

            Thank you ver much Ned! This was exactly what i was looking for