Groups | Blog | Home
all groups > flash actionscript > december 2006 >

flash actionscript : Connecting images in library to one "next " button


dhanson1971
12/8/2006 8:35:11 PM
:confused; Have multiple images in my library and have them loading into a mask
on my stage. Have my buttons, but I want to create one button that will allow
the user to scroll through the images by pressing the same button, instead of
having to create individual buttons for each image. Can't figure it out - maybe
someone knows and can help me. Right now, each image is in my timeline on a
separate layer, but I could put them all on the same layer in different frames
and name the frames - then use an if/else statement to make it move through the
range of frames? I tried this thought process and couldn't get it to go. Thanks
in advance for any help you can give me.
kglad
12/8/2006 8:52:24 PM
cinemaguy
12/8/2006 8:55:31 PM
You can load your images into an Array and then have the buttons load the next
image in the Array. Ex...

imageNum:Number = 1;
var imageArray:Array = ["image1.jpg","image2.jpg","etc..."];
nextBtn.onRelease = function() {
if (imageNum<= imageArray.length) {
mcToLoadImageInto.loadMovie(imageArray[imageNum+1]);
imageNum++
}
}
kglad
12/9/2006 12:23:09 AM
AddThis Social Bookmark Button