Help with Flash 7 Actionscript

Any off topic discussions should go in this forum. Post count is not increased by posting here.
FTP Access status is required to post in this forum. Find out how to get it
Forum rules
Any off topic discussions should go in this forum. Post count is not increased by posting here.
FTP Access status is required to post in this forum. Find out how to get it
Locked
Corny Cole
User avatar
FTP Access
Posts: 28
Joined: Tue Jun 17, 2008 12:47 am
Location: Friul, Italy

Help with Flash 7 Actionscript

Post by Corny Cole »

Is there a line of actionscript code for Flash 7 which randomizes between going on two different frames? If yes, please tell me what it is.


Basically all I want to do: When somebody comes to my web page, they either get Frame 1 or Frame 2 with frame 1 a more probable outcome

tomwalter
FTP Access
Posts: 48
Joined: Tue Jul 08, 2008 10:06 am

Post by tomwalter »

Frame 1: contains the actionscript:

Code: Select all

ranNo = Math.random();
if(ranNo >= 0.25){
	gotoAndStop(2);
}else{
	gotoAndStop(3);
}
Frame 2: is the most probable frame (3 in 4)
Frame 3: the less likely (1 in 4)

you can muck around with the probability

Corny Cole
User avatar
FTP Access
Posts: 28
Joined: Tue Jun 17, 2008 12:47 am
Location: Friul, Italy

Thank You

Post by Corny Cole »

Thank you, It works!

supreme win3x

Post by supreme win3x »

Thank You

hounsell

Post by hounsell »

A pointless bump. Please read the rules. Posts that consist of 'Ok', 'Thank you', etc don't count as contributing anyway.

Topic Locked

Locked