Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"random" homepage...? 1

Status
Not open for further replies.

DGTLguy

Technical User
Jul 23, 2003
125
0
0
US
i am trying to create a "random" homepage... i want to have code on the first frame of my movie that tells flash to "randomly" select frame 2, 3, 4, or 5 each time a user visits my site...

can anybody point me in the right direction?...
 
frame 1

this.onEnterFrame = function(){
gotoAndStop(2 + Math.floor(Math.random()*5));
delete this.onEnterFrame
}
 
beautiful... it worked like a charm... i appreciate your help...

would you mind explaining that bit of code in layman's terms? just to help me understand the process... if so, thanks in advance, if not... thanks in advance...
 
This can also work using this script:

//first frame

gotoAndStop(random(s)+1);

//

Just replace s with the number of frames you want it to chose from
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top