Hi I know how to load jpgs dynamically, All I want is to use loaded jpgs as a photo slideshow, using only two buttons (Next and Previous) So what code goes for those buttons ?
Printable View
Hi I know how to load jpgs dynamically, All I want is to use loaded jpgs as a photo slideshow, using only two buttons (Next and Previous) So what code goes for those buttons ?
Name the jpg's sequentially. image1.jpg image2.jp and so on.
On first keyframe.
_root.i=0;
//NEXT button
on(release){
_root.i++;
container.loadMovie("image"+_root.i+".jpg");
}
//BACK button
on(release){
if(_root.i>1){
_root.i--;
container.loadMovie("image"+_root.i+".jpg");
}
}
Thanx dude, I hope this helps.
Thanx dude it's working fine but at the very last image it gives error image not found. I'm really noob to actionscripting so plz tell me how to correct it. Thanx
You can add a variable where you tell how many images there are.
// On first frame
_root.image_amount=5;
...and add to the NEXT button
//NEXT button
on(release){
if(_root.image_amount<6){
_root.i++;
container.loadMovie("image"+_root.i+".jpg");
}
}
OH Well working fine, But how can I use Progress bar component with those external jpgs ? Thanx
You can have the code ON the container clip itself too...something like....
onClipEvent (enterFrame) {
tb = math.round(this.getBytesTotal()/1024);
lb = math.round(this.getBytesLoaded()/1024);
perc = math.round((lb/tb)*100);
if (lb>=tb) {
_parent.loadBar._visible = 0;
} else {
_parent.perc = perc;
_parent.loadBar._width = perc;
_parent.loadBar._visible = 1;
}
}
loadBar being a small movieclip on the main timeline.( or the same timeline the container clip is at ).