A Flash Developer Resource Site

Results 1 to 2 of 2
  1. #1
    Junior Member
    Join Date
    Jan 2013

    Flash cs6 Button to access random scenes

    I am developing a flash puzzle game but am only started to learn actionscript 3.
    I have three scenes named puzzle1, puzzle2, puzzle3 and I am trying to figure out a way to randomly direct the user to one ofthe three scenes when they press a button on the timeline.

    Once the user has completed the puzzle in the scene they should be able to access the other two scenes.

    I know how to use code snippets to link a button to a certain scene but is there a way to randomly direct the user to one of three scenes. I have looked online but couldn't find any way to set this up.

    If anyone would be able to provide some advice or a possible solution it would be greatly appreciated. Thanks in advance.

  2. #2
    Senior Member Steven FN's Avatar
    Join Date
    Mar 2010
    CA, USA
    I would use Frames instead of Scenes to start off. Then use Math.random() to gotoAndStop() on the random frame. And to eliminate options, use an Array to hold the different puzzle/frames and splice() each chosen item until there are no more puzzles.

    Hope that gives you an idea of how to set it up and where to go.

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

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.