Our Swish tutorials provide you with step-by-step instructions on how to create beautiful Flash animations and integrate them into your website.  Home Flash & Swish Swish Tutorials Simple Image Viewer

Simple Image Viewer


Example:

Use the sample above to see how it works.

Controls

Use the next button to view the next image & the back button to view the previous image

Add the following code to Scene_1.

onEnterFrame() {
_root.imnumber=_root._currentframe;
_root.totframe=_root._totalframes;
}
onFrame (1) {
stop();
}
onFrame (5) {
stop();
}

Now you need two dynamic text boxes, one called imnumber, this will show your image number. And one called totframe, this will show how many images there are.

Yo now need two buttons one called next and one called previous or back. Place these where you wish them to be, take a look at the layout on the example above for ideas.

On the next button add the following code.

on (release) {
if (this._currentframe == this._totalframes) {
gotoSceneAndStop("",1);
} else {
nextFrameAndStop();
}
}

On the back or previous button place the following code.

on (release) {
if (this._currentframe == 1) {
gotoSceneAndStop("",this._totalframes);
} else {
prevFrameAndStop();
}
}

Now import all the images you wish to use, 5 for now.

On each frame add a place effect from the add effects button.

Until you reach frame 5, thats it press Ctrl+T to test it out.



Author's URL: Craig Lowe
Final results of our readers
New!
Passed through all the steps? Share your result!
Your result will be premoderated.
Please make sure you choose the right image.
 
 



Captcha

*Required fileds
Our Swish tutorials provide you with step-by-step instructions on how to create beautiful Flash animations and integrate them into your website. More Swish Tutorials: Featured Materials | Fresh Materials | More Swish Tutorials at FlashPerfection.com

No comments yet...
Add comments to "Simple Image Viewer"

Captcha