1 Reply Latest reply on May 7, 2014 10:52 AM by kglad

    key and lock


      Okay Hi I am kinda of new to Flash and I been learning it in college but I don't know the code well the picture below should explain it


      Basically I want the code for this. I want the player to hit the key which will remove the lock from the screen.

      Any help appreciated thanks

        • 1. Re: key and lock
          kglad Adobe Community Professional & MVP

          use a loop (like enterframe) to repeatedly check a hittest between player and lock.  eg:




          function hitF():Void{


          lock_mc.removeMovieClip();  // use swapDepths on lock_mc if it's at depth less than zero

          delete this.onEnterFrame;