Is flash buggy or my doing something wrong

well i tried to implement a asc3 code of mine …i would be greatfull if you all newbs or experts to look at it and see whats wrong in my method…

purpose was something simple…

i have three different background settings… i want that everytime you load the swf that a random background will appear…

somehow often 1st background shows BUT the others never do show or if they do its blank or just totally wrong…

here is attachment to my work i did so far…

thank you so much for time and patience

should be

Math.floor(Math.random()*3)+1;

well if try run swf it never loads the third background …

there is something wrong with it or runs well on yours…when you run it do you see all three randomly appear as seems to me always 1 or two ,

thank you

Sekasi is correct. That’s the exact problem. Times 3, not times 2. Pay attention! :smiley:

thanks for the response my friends but i think as kirupa doesnt allow me to load the file here properly as minimal size…

i posted the file properly at http://www.actionscript.org/forums/showthread.php3?p=762229&posted=1#post762229

please look at my post and not the gentlemans…

AND GOOD LUCK…he even tried and wasnt able to but gave me his version to the problem with his solution which isnt what i really wanted…

the GOTOANDPLAY…doesnt work as it should or i am using wrong coding in asc3…

i will repeat scenario here even…

what i want to do or have to try to do if possible is i have 5 layers separated into 3 sections…
so from frame 1-10, 11-20, 21-30…each time i load the swf it loads one of the 3 background may it be frame 1 or 11 or 21…

code i used to do this on AS3 flash cs3 is this …

var attempt:int = Math.round(Math.random()*5)+1;
switch (attempt) {
case 1 :
gotoAndStop(1);
break;
case 2 :
gotoAndStop(11);
break;
case 3 :
gotoAndStop(21);
break;
}

**the issue with this code 1) does not realy random as some reason third background never does appear…
2) also for some reason sometimes instead going to frame 10 it goes to 9…like wtf…

well try it my friends and let me know why or where i went wrong as i thought i did it right

thanks again i appreciate any insight from any newbs or experts as i believe any help is great help

thanks **also dont lose much hair figuring this one :wink: i trying to hold my last