PDA

View Full Version : issue with random movie loading


uaveeman
03-08-2006, 04:47 PM
I'm new to flash. I have MX 2004. went with a template to try and learn some of it on my own. it loads a random image for the homepage and each following subpage. from what I can gather, it takes all the information from these two commands:

loadMovie("galleries/home/"+_root.poza+".jpg", "pic1");

and

_root.createEmptyMovieClip("s", 1);
_root.s.onEnterFrame = function() {
t = pic1.getBytesTotal();
l = pic1.getBytesLoaded();
trace(l);
if (l == t and t != -1) {
gotoAndPlay(3);
removeMovieClip(_root.s);
}
};
stop();


the template also had two buttons, a previous and next button to move through the images...
code for previous button:

on (press) {
if (_root.poza>1) {
_root.poza--;
} else {
_root.poza = 3;
}
pics.gotoAndPlay(1);
}



code for next button:

on (press) {
if (_root.poza<3) {
_root.poza++;
} else {
_root.poza = 1;
}
pics.gotoAndPlay(1);
}

The template came with 3 photos to randomly show up on the pages...but now I have 8 images that i would like to show. can I change this somehow to file through my 8 pictures instead of 3?

Thanks for any help!
regards,
David V.

lek_ccl
03-09-2006, 04:11 PM
i guess ur images are named 1.jpg 2.jpg 3.jpg .....
from the info u provided above, i suppose u can named your images according to the above convention, then change the number "3" to "8" in the following part:

on (press) {
if (_root.poza>1) {
_root.poza--;
} else {
_root.poza = 3;
}
pics.gotoAndPlay(1);
}

------------and---------

on (press) {
if (_root.poza<3) {
_root.poza++;
} else {
_root.poza = 1;
}
pics.gotoAndPlay(1);
}

uaveeman
03-09-2006, 11:54 PM
that worked! I dunno why I couldnt figure that out! Thanks so much!