3 Replies Latest reply on Jun 18, 2010 1:54 PM by kglad

    Simple game problem

    DanBenn

      I am trying to create the foundation for a simple platforming game. I want to make the game play a short animation applies when the player controlled character collides with an invisible (alpha=0) object. This seems like it should be extremely simple, but after searching the web for a very long time I have not been able to find a piece of actionscript that does this simple task. I am working in Flash MX and have tried many variations on this code, and none of them have worked:

       

      onClipEvent (load) {

           if(this.hitTest(_root.char)){

                gotoAndPlay(2);

      }

      }

       

      I have tried putting this code in the actions of the invisible trigger of the animation, as well as putting a piece of code replacing ".char" with ".triggera" in the character's actions

      I have it set up so that the playable game is on frame 1, and the short animation is from frames 2-90, concluding in another game screen.

       

      Please help!