PDA

View Full Version : random


dmyst3
02-21-2006, 02:35 AM
hi i am trying to create a a flash file with this code var nRandom = 1+Math.floor(Math.random()*3);
gotoAndStop(nRandom);
on my web page so when you go to it it will generate a random graphic it work the only problem is that it glitches like let say it generate frame 1 but quickly it jumps to frame 2 so instead of seeing 1 graphic you see frame1 for a slplit sec and then it jumps to frame2...........

noreliq
02-21-2006, 02:45 AM
where exactly in your swf have u placed that code?

deathcloud33
02-21-2006, 03:24 AM
It is probably loading the flash, showing the first image, then executing the script.
You need to have the first frame be blank, then go to the respective frame, or you can dynamically load the picture into one frame, but that'd be alot more complicated than necissary.

BlackDragon
02-21-2006, 04:14 AM
try going to each frame and placing

stop();

dmyst3
02-21-2006, 10:32 PM
thanks deathcloud33it work i forget to leave the first frame blank what happe was the random code was in the first frame so as the graphic anywayz thanks alot. and also thanks to you guys
BlackDragon and noreliq

dmyst3