edoky145
11-02-2006, 01:18 AM
Please Help! I have created a flash thing for a client's website but there seems to be some bug. I want the file to start at different random labeled frames.
I have inserted the following code
function getRandomLabel():String {
var labels:Array = new Array("pointA", "pointB", "pointC", "pointD", "pointE", "pointF");
var index:Number = Math.floor(Math.random() * labels.length);
trace ( index )
return labels[index];
}
this.gotoAndPlay(getRandomLabel());
And with my test file it was working fine. But as I inserted all my frames and labels it's not working anymore. For some reason when it tries to jump to the 4rth or 5rth label in the array it just defaults back to the 1st label.
Oh and also. When I test it out of flash it semi works. But then why I try to test out of flash player or firefox it starts at the first frame all the time. BUT it works in safari? What the ?@#$$ is going on?
Why is this happening?
Here is the swf file
http://www.edleedesign.com/elo/test.html
and here is the .fla file
http://www.edleedesign.com/elo/test.fla
I have inserted the following code
function getRandomLabel():String {
var labels:Array = new Array("pointA", "pointB", "pointC", "pointD", "pointE", "pointF");
var index:Number = Math.floor(Math.random() * labels.length);
trace ( index )
return labels[index];
}
this.gotoAndPlay(getRandomLabel());
And with my test file it was working fine. But as I inserted all my frames and labels it's not working anymore. For some reason when it tries to jump to the 4rth or 5rth label in the array it just defaults back to the 1st label.
Oh and also. When I test it out of flash it semi works. But then why I try to test out of flash player or firefox it starts at the first frame all the time. BUT it works in safari? What the ?@#$$ is going on?
Why is this happening?
Here is the swf file
http://www.edleedesign.com/elo/test.html
and here is the .fla file
http://www.edleedesign.com/elo/test.fla