HELP: random frame percentage

hi,

got a problem at the moment.

i have this syntax in frame 1:

stop();

var percent = (random(100)+1);
if (percent>=1 and percent<40) {
	var i = random(2);
} else if (percent>=40 and percent<=100) {
	i = "exit";
}
gotoAndStop(i);

on frame 2 i have a picture and a stop(); and on frame 3 i have another picture with another stop();

basically the code is to go to one frame more times then the other frame, in this case 40% of the time it will go to frame 2 while 60% of the time it will jump to frame 3.

when i run the swf on my computer it works fine! however when i upload the swf to the web it dosent work at all, it act as if the code isnt even there. the swf is being externally loaded, coudl this be the problem?

thankyou

Bigbalroo:}