if you have image files names like ima001.jpg, ima002.jpg,...,ima005.jpg, you should use:
imagenes_mc.loadMovie("ima00" + (Math.ceil(Math.random()*5)) + ".jpg");
p.s. the error message about mages_mc is not related to the code you posted.
Yes, my images are five and are named ima001.jpg, ima002.jpg..
I used this code u posted aplyed to the general timeline and i got as output:
TypeError: Error 1006:loadMovie is not a function.
at bg_fla::MainTimeline/frame1 ()
Then i tryed aplying the code to the first frame of the mc and then i got:
1120: Access of undefined property imagenes_mc
What could be wrong? My mc instance is named correctly "imagenes_mc"
Thanks a lot
change your publish settings to as2. retest.
i did. it was action script 1 and 2, not 3
code applyed to the first frame of the general timeline, not to the first of the mc's timeline
and i get that same output
oh no, sorry.
it was as 1 and 2 on the actions panel, now i configured on the publish settings and i got as output:
Error opening URL 'file:///C|/Documents%20and%20Settings/user/Desktop/Casa/site/Flash%5Fwebsite/images/ima0 04.jpg'
i will test online and see what happens. i let you know
i did a correction in the name of jpeg 004 and published on as2 and it was working perfect offline.
the problem is: that swf is only a backgraound on a flash website exported as as3 and when i put it online, it did not appeared at all
(all images and new swf was online)
could it be a conflict between the different formats?
the website is managed by xml files and i dont know if i could have problems if publishing everything on as2..
is there any way to publish on as3?
thanks for all
you can publish for as3 but you'll need to change your code:
var ldr:Loader=new Loader();
ldr.load(new URLRequest("ima00" + (Math.ceil(Math.random()*5)) + ".jpg"));
i used this new code and published on as3 and it works perfect offline
But when i put it online it does not appear at all...
The first swf i had online as a common movie, (no random) and it was working good
I dont have ant idea why it does not work. Do you have any clue?
what's the url?
Now its working good ! It was my connection. I will use less quality to make images less heavier
It took long time to appear for the first time and now is working good
I could see that besides the random of images each time i load the page, they keep changing with the time, i like that
Thanks a lot for your help!