A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: random events in flash v.3 ?

  1. #1
    Junior Member
    Join Date
    Mar 2000
    Posts
    13

    Question

    is it possible to have random events in flash 3? i would like to set a button to go to one of 8 possible events, but since variables aren't used in v.3 i haven't been able to find a workaround.

    any ideas anyone?

    chundle

  2. #2
    Senior Member
    Join Date
    Feb 2000
    Posts
    195

    Talking

    Piece of cake

    Here's the easiest way to do it:

    Just put your button inside a looping movie clip. This movie clip should have 8 keyframes, each containing an instance of the same button. Now, here's the trick.. All the keyframes will LOOK the same, but you can give each button a different action! The user will have no idea that the button is continually changing.. but each time they click it, chances are they will hit a different button.

    Essentially, the trick is to use the user as the random element!

    I hope that will work in Flash 3, I think it will.. If you have any questions, let me know!

    ------------------
    Scott Richards
    http://www.rjscs.com/scotty
    scotty@rjscs.com

    [This message has been edited by scottris (edited 05 March 2000).]

  3. #3
    Senior Moderator
    Defender of the Faith
    Pope de Flash's Avatar
    Join Date
    Feb 2000
    Posts
    3,429

    Post

    Great basic game code. All the early shooting games use this method. I still use it for games. Check out "Get flippy" in the competion section of the games. All done with flash 3 code. Regards, Bill

    ------------------
    Macromedians 1:1

    In the beginning the web was without shape and color, and the hype covered the darkness of the net. Then there was a Flash and life came to the web and vision became reality.

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