1 person found this helpful
That is AS3 code, so you should post in the AS3 forum. The code you show will not continuously change images. There is something else that will make that happen, either some timer that activates periodically, or maybe your timeline loops back to that frame. If it is the latter, then you need to have a stop(); command to keep the timeline from looping.
Thanks a lot Ned
I did the change and now it does not load other images in sequence, however the
swf is not working online. It was correctly exported on AS3 and the website is
all AS3. All the images and the swf are online, inside the same folder.. etc.
The random is a background image, essential to make the design work out. Do you
know the reason this is not working online, only off line?
The code i´m using in one frame movie is this one:
var ldr:Loader=new Loader();
ldr.load(new URLRequest("ima00" + (Math.ceil(Math.random()*5)) + ".jpg"));
Thanks a lot
If it works locally and not online, the problem is usually the location of the files. If the swf and images are in the same folder, but the html page is in a different folder, then you need to alter the targeting within the swf as if the swf is in the same folder as the html file. Even though the swf is in the same folder as the images, when it is loaded into the html page, that is its new relative home... something to the tune of...
ldr.load(new URLRequest("FOLDERNAME/ima00" + (Math.ceil(Math.random()*5)) + ".jpg"));
Thanks a lot Ned!
It was that, index was outside of the main folder. I just copied the files, and
now it's working perfect.