A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [RESOLVED] Easy Random Number Button (Question)

  1. #1
    Senior Member
    Join Date
    Mar 2005
    Location
    U.S.A . VA.
    Posts
    108

    resolved [RESOLVED] Easy Random Number Button (Question)

    I thought this would be an easy task, but so far its proved to be aggervating!

    Sumary:
    So i have this Play button that i want to have a small chance of playing from a different frame.

    on the 1st frame (one right before the button) I have a variable set
    Actionscript Code:
    Shiny = 0
    On the frame of the button I have
    Actionscript Code:
    stop ();
    And on the button i have
    Actionscript Code:
    on (release) { var wv:Number = random(13);  
    wv += Shiny
    gotoAndPlay(3);
    }

    Ok.. so it works as a play button...
    But at frame 12 i have (in the frame)
    Actionscript Code:
    if (_root.Shiny = 12){
         gotoAndPlay
         (26);
    }

    But no matter what I do it always plays from frame 26

    I know ive gotta be close with this
    what have i done wrong?

    thanks for reading
    How can you say so much, but say so little?

  2. #2
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    == compares
    = assigns

    You'll need to change the operator in the if statement.

    gparis

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