-
next, prev. buttons !! Help plz
Hi,
I have a series of images (01.jpg, 02.jpg, 03.jpg, .....)
and i want t load the pic. with next and prev. buttons, next to load the next picture and prev. to load the prev. one, but it's too much pictures so i want it to be dynamic and at the end of the pictures to disable the next button and at the first picture to disable the prev. button. something like picture gallery
thanks in advance
cheers
-
put them in array
and save a var on the side, if the ver is first or ladt disable the buttons
-
thanks for ur reply
but I dont know how to do it
-
any help about this ?
i have the same problem i guess
-
Script for you
Hi,
I hope the below code gives the answer for your requirement.
Given below are the guidelines for the script to work.
1. Place the code on the first frame of the main time frame.
2. name the images as "01.jpg","02.jpg" etc and keep them in the same folder where the swf resides...
3. Name the movie clip instances as below
Image Holder - imgHolder
Back Button - prevButton
Next Button - nextButton
4. Change the value totalNoofImages based on the Number of Images you are using.
This can be defined as a component also. just try that and let me know how it works.
----------------------------------------------------------------------
currentImgNo = 1;
totalNoofImages = 4;
prevButton.enabled = false;
imgHolder.loadMovie("01.jpg");
prevButton.onRelease = function() {
nextButton.enabled = true;
currentImgNo--;
loadImage();
if (currentImgNo == 1) {
prevButton.enabled = false;
}
};
nextButton.onRelease = function() {
prevButton.enabled = true;
currentImgNo++;
loadImage();
if (currentImgNo == totalNoofImages) {
this.enabled = false;
}
};
function loadImage() {
if (currentImgNo<9) {
currentImgString = "0"+currentImgNo;
} else {
currentImgString = currentImgNo;
}
currentUrl = currentImgString+".jpg";
imgHolder.loadMovie(currentUrl);
}
stop();
----------------------------------------------------------------------
Fun is the best way to
learn.
Shan
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|