-
Creating A Dynamic Slideshow ?
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 ?
-
Senior Member
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
-
Senior Member
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
-
Senior Member
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 ).
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
|