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

Simple Image Gallery for the Flash Beginners


We are going to use ActionScript 2.0 here, so lets start with a New AS 2.0 Document in Flash CS3.

image 1

Next thing we need to do is define the size of the Scene, which is the size of our flash gallery. I want my pictures to be 300*300 pixels in size and 60*60 sized thumbs, so my gallety size should be 300*360 pixels.

image 2

Now we'll need to use the Rectangle Tool to create a white rectangle with white border. Once rectangle is in place, rightclick on it and "Convert into symbol…" - we need to convert it into movie, and the name of it does not really matter.

If the movie clip that you resulted with is not precisely 300*300 pixels, you can easily fix that in the Properties menu below. To have it sit at the very top of the Scene assign 0 values to X and Y cordinates of it.

Important: You should fill in the setting with a word Viewer just like it is shown below.

image 3

Double click on the movie to get into it, and lets start adding pictures and frames. To import pictures, you just need to drag'n'drop them into the library to the right.

image 4

Leave the first keyframe untouched and add 5 more Keyframes (1 per picture). This is done by rightclicking the empty frame and choosing "Insert Blank Keyframe".

image 5

I have 6 keyframes in total now. And now we'll need to insert pictures there. The first keyframe will only contain a phrase like "please pick an image". To add it, you need nothing but a Text Tool.

image 6

We also need to add a little bit of an action script to this frame. Rightclick on it, and choose "Actions" in the drop down menu. In the actions frame add the following code:

stop();

Then highlight the second frame and drag there a picture from your library. Position the picture at 0 for X and Y. Fill in all the frames with their own pictures.

image 7

Double click twice out of the movie regions to go back, or click the "Scene 1? Link. Now let's make a tiny thumbnails out of our pictures. Drag them from the library, resize to 60*60 pixels and position right below the movie clip.

We need to make buttons of those thumbnails to make our flash file work. To do that, highlight them one by one and press F8 to convert them into Buttons. The names you assign do not matter. As a result you should have 5 tiny buttons right below the Movie clip.

Simple Image Gallery for the Flash Beginners

Now select the first button, and rightclick on it to insert some Actionsript inside. "Actions" is what you looking for. And the script you need to add goes like this:

on (release) {
viewer.gotoAndStop ( x );
}

Where you need to change X to the number of the frame this button refers to. My first button refers to a picture of a cute girl, which I have placed in the second frame, so I will type 2 instead of X. The next button will refer to 3rd frame, so I wil insert the same code to the second button, but will change X to 3. So in my last button I have replaced X to 6 and everything is ready now.

You can press Ctrl + Enter to check if our flash gallery is working fine. And I am sure it is!

Moreover you can change the buttons to respond whenever you hang your mouse cursor over them instead of clicking. The code for each button will be:

on (rollOver) {
viewer.gotoAndStop ( x );
}
on (rollOut) {
viewer.gotoAndStop (1);
}

And don't forget to change X to a proper frame! Hope you have enjoyed this very basic tutorial on creating a simple flash gallery.



Author's URL: 10Steps.SG
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 Flash tutorials provide you with step-by-step instructions on how to create beautiful Flash animations and integrate them into your website. More Flash Tutorials: Featured Materials | Fresh Materials | More Flash Tutorials at FlashPerfection.com

Reader's comments
comments Emma December 13, 2010 says:
I love this tutorial and I have followed it to the letter except I used 3.0. I get as far as adding code to the buttons, and it says 'current selection cannot have action applied to it'! Please can you help me??
Reply
comments satish chandra June 10, 2010 says:
It's your very nice flash.............
Reply
Add comments to "Simple Image Gallery for the Flash Beginners"

Captcha