A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Game controller - tracking clicks to unlock an action

  1. #1

    Game controller - tracking clicks to unlock an action

    I have a simple game controller graphic (like that of Playstation) that I'd like to program to do things when a certain order of clicks are performed. For example, if a user clicks the four buttons on the controller in this order: left, right, bottom, left, I want the Flash to then take them to a specific URL. Is there any tutorials on how to do this? I am using Flash CS3, and I'm familiar with Actionscript 2.0, but by no means a AS programming pro.

    Thanks!

  2. #2
    Funkalicious TOdorus's Avatar
    Join Date
    Nov 2006
    Location
    Nijmegen, Netherlands
    Posts
    697
    look up Arrays and Switch. There are probably some tutorials on the subject of arrays and switch statements.

    You store the combinations in an array and store each keypress in an array. Then you can check via a tree of switch statements which combination you're dealing with.

    Another way would be to loop through every array, comparing each array to the current combination array. You'll need to look up for loops for that one.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center