I am trying to load a random jpg into a flash movie…I do not want it to be the background, so the (loading a random background tutorial did not help…I am sure it held alot of the concepts that I need to know)
I am new to flash and am not good at actionscript…
I realize that I need to create x number of swf files for the load…
but I do not know how to tell it where to load it…place it
You could load your swf names into an array, and choose a random number from the array…
myarray=["first.swf","second.swf","third.swf"];
picker=math.floor(math.random()*((2)+1));//pick zero, one, or two
mymovie.loadmovie(myarray[picker]);//pick an item from array
so, combine both posts, and you should have what you want. Let me know if you have questions.
_root.createemptymovieclip("empty");
empty._x=15;
empty._y=0;
myarray=["random1.jpg","random2.jpg","random3.jpg","random4.jpg","random5.jpg","random6.jpg","random8.jpg"];
****this is where I get confused*********
picker=math.floor(math.random()*((2)+1));//pick zero, one, or two
mymovie.loadmovie(myarray[picker]);//pick an item from array
also does it matter where I place these jpg’s, or do they have to be imported into the library?
_root.createemptymovieclip("empty");
empty._x=133;
empty._y=0;
myarray=["random1.jpg","random2.jpg","random3.jpg","random4.jpg","random5.jpg","random6.jpg","random8.jpg"];
picker = math.floor(math.random()*(4));// add 1 digit whenever u got more files
mymovie.loadmovie(myarray[picker]);//pick an item from array
when I insert this EXACTLY into my movie nothing happens…
I don’t know what I am doing wrong but could definitly use some help…
Thanks so much already guys,
Casey
p.s. I know the x,y values are different…but they are correct…fyi…to clear up any confusion
nothing nothing…
or load one jpg, just one…
try the code i used it’s working with me.
but if you load one jpg … it’s work too but it’ll change to another one when reach frame 25 for second time…
i think you need it change all time not in specific frame… RIGHT?
i hope you fix your Prob.