Hi,
I’m having trouble generating a random number between 1 and 4.
My script looks like this;
y = random(4)+1;
if (y=1) {
this.gotoAndPlay(“Effect1”);
} else if (y=2) {
this.gotoAndPlay(“Effect2”);
} else if (y=3) {
this.gotoAndPlay(“Effect3”);
} else if (y=4) {
this.gotoAndPlay(“Effect4”);
}
It always seems to go to “Effect1”, as if it’s just skipping the Frame with this ActionScript on it and going to the first effect, which is the next thing down the timeline.
I know this probably very simple, but could someone help me out with this.
Thanks alot,
Matt