I am a photographer and also design my own site. Please visit http://www.adamstockland.com to view what I am trying to do. As it is now my images are loaded via a function that is called when one of the icons is pressed. What I am having trouble doing is creating a “next” and “back” btn or a slideshow. What I have been trying to do is have a hidden text box that holds a dynamic image # (instance name = ImageNumber). Then I am trying to attach a function to the “next” btn that basically says “if” image number = 1 load image 2 else if image number = 6 load 7, and so on. I cant seem to get it all to work. Any ideas??
Here is my code. The “next btn” function is limited to three statements as I am just trying to get it to work. Eventually it will have 34 statements…once I get it work properly…
All other function are working properly.
My code:
stop();
//load initial image
infoField._visible = true;
ImageNumber.text = “1”;
startLoading(“portfolio/images/image1.jpg”);
//
//next_btn function
this.next_btn.onRelease = function() {
if (this.ImageNumber.text=“2”) {
ImageNumber.text = “3”;
startLoading(“portfolio/images/image3.jpg”);
} else if (this.ImageNumber.text=“3”) {
ImageNumber.text = “4”;
startLoading(“portfolio/images/image4.jpg”);
} else if (this.ImageNumber.text=“4”) {
ImageNumber.text = “5”;
startLoading(“portfolio/images/image5.jpg”);
}
};
//
this.icon1_mv.icon1_btn.onRelease = function() {
infoField._visible = true;
ImageNumber.text = “1”;
startLoading(“portfolio/images/image1.jpg”);
};
this.icon2_mv.icon2_btn.onRelease = function() {
infoField._visible = true;
ImageNumber.text = “2”;
startLoading(“portfolio/images/image2.jpg”);
};
this.icon3_mv.icon3_btn.onRelease = function() {
infoField._visible = true;
ImageNumber.text = “3”;
startLoading(“portfolio/images/image3.jpg”);
};
this.icon4_mv.icon4_btn.onRelease = function() {
infoField._visible = true;
ImageNumber.text = “4”;
startLoading(“portfolio/images/image4.jpg”);
};
this.icon5_mv.icon5_btn.onRelease = function() {
infoField._visible = true;
ImageNumber.text = “5”;
startLoading(“portfolio/images/image5.jpg”);
};
this.icon6_mv.icon6_btn.onRelease = function() {
infoField._visible = true;
ImageNumber.text = “6”;
startLoading(“portfolio/images/image6.jpg”);
};
this.icon7_mv.icon7_btn.onRelease = function() {
infoField._visible = true;
ImageNumber.text = “7”;
startLoading(“portfolio/images/image7.jpg”);
};
this.icon8_mv.icon8_btn.onRelease = function() {
infoField._visible = true;
ImageNumber.text = “8”;
startLoading(“portfolio/images/image8.jpg”);
};
this.icon9_mv.icon9_btn.onRelease = function() {
infoField._visible = true;
ImageNumber.text = “9”;
startLoading(“portfolio/images/image9.jpg”);
};
this.icon10_mv.icon10_btn.onRelease = function() {
infoField._visible = true;
ImageNumber.text = “10”;
startLoading(“portfolio/images/image10.jpg”);
};
this.icon11_mv.icon11_btn.onRelease = function() {
infoField._visible = true;
ImageNumber.text = “11”;
startLoading(“portfolio/images/image11.jpg”);
};
this.icon12_mv.icon12_btn.onRelease = function() {
infoField._visible = true;
ImageNumber.text = “12”;
startLoading(“portfolio/images/image12.jpg”);
};
this.icon13_mv.icon13_btn.onRelease = function() {
infoField._visible = true;
ImageNumber.text = “13”;
startLoading(“portfolio/images/image13.jpg”);
};
this.icon14_mv.icon14_btn.onRelease = function() {
infoField._visible = true;
ImageNumber.text = “14”;
startLoading(“portfolio/images/image14.jpg”);
};
this.icon15_mv.icon15_btn.onRelease = function() {
infoField._visible = true;
ImageNumber.text = “15”;
startLoading(“portfolio/images/image15.jpg”);
};
this.icon16_mv.icon16_btn.onRelease = function() {
infoField._visible = true;
ImageNumber.text = “16”;
startLoading(“portfolio/images/image16.jpg”);
};
this.icon17_mv.icon17_btn.onRelease = function() {
infoField._visible = true;
ImageNumber.text = “17”;
startLoading(“portfolio/images/image17.jpg”);
};
this.icon18_mv.icon18_btn.onRelease = function() {
infoField._visible = true;
ImageNumber.text = “18”;
startLoading(“portfolio/images/image18.jpg”);
};
this.icon19_mv.icon19_btn.onRelease = function() {
infoField._visible = true;
ImageNumber.text = “19”;
startLoading(“portfolio/images/image19.jpg”);
};
this.icon20_mv.icon20_btn.onRelease = function() {
infoField._visible = true;
ImageNumber.text = “20”;
startLoading(“portfolio/images/image20.jpg”);
};
this.icon21_mv.icon21_btn.onRelease = function() {
infoField._visible = true;
ImageNumber.text = “21”;
startLoading(“portfolio/images/image21.jpg”);
};
this.icon22_mv.icon22_btn.onRelease = function() {
infoField._visible = true;
ImageNumber.text = “22”;
startLoading(“portfolio/images/image22.jpg”);
};
this.icon23_mv.icon23_btn.onRelease = function() {
infoField._visible = true;
ImageNumber.text = “23”;
startLoading(“portfolio/images/image23.jpg”);
};
this.icon24_mv.icon24_btn.onRelease = function() {
infoField._visible = true;
ImageNumber.text = “24”;
startLoading(“portfolio/images/image24.jpg”);
};
this.icon25_mv.icon25_btn.onRelease = function() {
infoField._visible = true;
ImageNumber.text = “25”;
startLoading(“portfolio/images/image25.jpg”);
};
this.icon26_mv.icon26_btn.onRelease = function() {
infoField._visible = true;
ImageNumber.text = “26”;
startLoading(“portfolio/images/image26.jpg”);
};
this.icon27_mv.icon27_btn.onRelease = function() {
infoField._visible = true;
ImageNumber.text = “27”;
startLoading(“portfolio/images/image27.jpg”);
};
this.icon28_mv.icon28_btn.onRelease = function() {
infoField._visible = true;
ImageNumber.text = “28”;
startLoading(“portfolio/images/image28.jpg”);
};
this.icon29_mv.icon29_btn.onRelease = function() {
infoField._visible = true;
ImageNumber.text = “29”;
startLoading(“portfolio/images/image29.jpg”);
};
this.icon30_mv.icon30_btn.onRelease = function() {
infoField._visible = true;
ImageNumber.text = “30”;
startLoading(“portfolio/images/image30.jpg”);
};
this.icon31_mv.icon31_btn.onRelease = function() {
infoField._visible = true;
ImageNumber.text = “31”;
startLoading(“portfolio/images/image31.jpg”);
};
this.icon32_mv.icon32_btn.onRelease = function() {
infoField._visible = true;
ImageNumber.text = “32”;
startLoading(“portfolio/images/image32.jpg”);
};
function startLoading(whichImage) {
loadMovie(whichImage, “imageLoader”);
_root.onEnterFrame = function() {
L = imageLoader.getBytesLoaded();
T = imageLoader.getBytesTotal();
P = Math.floor((L/T)*100);
if (P>1, P<25) {
this.infoField.text = “…”;
} else if (P>25, P<50) {
this.infoField.text = “1/4”;
} else if (P>50, P<75) {
this.infoField.text = “1/2”;
} else if (P>75, P<99) {
this.infoField.text = “3/4”;
} else if (P>99) {
this.infoField.text = “”;
this.infoField._visible = false;
delete this.onEnterFrame;
}
};
}