SlideShare a Scribd company logo
1 of 23
How To Create A Simple Image
    Gallery In Flash CS5



                    Prepared by: Lyndon Jeorge A. Mendoza
Overview
     In this tutorial we will show you how to create
an simple image gallery with thumbnails in Flash
CS5. We will apply a couple of simple, yet nice
transitions to the images and thumbnails. This will
require you to get the hands a bit dirty in animation
and action scripting. However, this is going to be
easy and fun! So here we go.
Step 1
Create a new file with ActionScript 3.0 and modify the document like it’s shown on
the screenshot below. You can enter the document properties via the admin panel
(follow the highlights in red) or pressing Ctrl+J.
Step 2
Add four images from your computer to your library. To do this press File => Imort
=> Import to library. You can also import the images directly to the stage, by
pressing Ctrl+R.

Next, create three new layers and give them the
names Buttons, Images and Actions. To rename a layer, double click on it and
type the text. See the shot below.
Notice that the first frame of each layer has a small circle on it. This
 is a blank keyframe. Once you put anything on the stage, the circle
 transforms into black dot which corresponds to the filled keyframe.




Go to the Buttons layer and select the first frame on the timeline. Drag the
images from your library to the stage (in case you haven’t imported them
right to the stage already) and modify their size to 114×85 px. Be sure to drag
the images to our document area which we’ve made black earlier.
Now you have your thumbnails on the stage. Set image alignment
selecting Align in Window menu, or just press Ctrl+K. Align pics to the
bottom and distribute horizontal center like it’s shown below.
Step 3
Our thumbnails are going to be buttons, so now we need to convert the images into
the Button symbols. Using the Selection Tool, right click on the first thumbnail
image and choose “Convert to Symbol”, or simply hit F8. In the opened window
set the type Button and name the symbol btn1. Click “OK” to save the changes. Do
this for the other three images and give them the names btn2, btn3 and btn4,
respectively.
Now we have to give each of these the same Instance Name which is a name to refer
to your symbol or object in ActionScript. Instance Name can be set in the Properties
panel which you can enter by selecting the necessary object on the stage. Instance
Name of the btn1 button will be btn1 and so forth.




  Right click on the first frame of the Buttons layer, select Copy Frames, go to the
  fourth frame and Paste Frames the same way. Or you can just drag the first frame
  up to the fourth cell to copy it. You timeline should have the following look by now.
Step 4
OK, let’s put the images that we will be exactly viewing in our gallery. Switch to
the Images layer and select the first frame on the timeline. Drag the image that
corresponds to the first thumbnail from your library to the stage. Size it down to
the 358×268 px and set its position to the 93×18. Of course, you may set your own
dimensions and place the pictures whatever you like; this is just what we use for this
tutorial.




Insert three more blank keyframes (F6) and do the same operation with the rest of the
images.
Now go back to the timeline, select the first frame and go to the Properties panel.
Here we will set the Frame Label. It’s important to remember about this because
we’re going to reference frame labels in the ActionScript later. We’ve got four frame
labels: model, dreamy, dancing and teacher, respectively.
Step 5
So far we’ve got a thumbnail gallery where each of the thumbs is a button. Our next
step is to add some action script so we could click on the button to play the right
frame. Go to the Actions layer and drag the first frame up to the fourth cell. Your
timeline should have the following look by this moment:
Go back to the first frame in the Actions layer and hit F9 to open the Actions window.
Copy and paste the following code into your Actions window. Don’t worry, we will explain in
great detail what happens shortly.




   stop();
   btn1.addEventListener(MouseEvent.CLICK,play1);
   function play1(event:MouseEvent):void{
   gotoAndStop ("young")
   }
    btn2.addEventListener(MouseEvent.CLICK,play2);
   function play2(event:MouseEvent):void{
   gotoAndStop ("thoughtful")
    }
    btn3.addEventListener(MouseEvent.CLICK,play3);
   function play3(event:MouseEvent):void{
   gotoAndStop ("dancing")
   }
    btn4.addEventListener(MouseEvent.CLICK,play4);
   function play4(event:MouseEvent):void{
   gotoAndStop ("old")
   }
After you have copied and pasted the above code, go to Control => Test Movie or
press Ctrl + Enter to see the result gallery. Here is what you should get:
Let’s look closer at what you’ve just done and learn more about AS functions. The
first thing you see in your code window is Stop action.



  Stop();

 Any effect you create in Flash repeats continuously when you test or publish your
 movie. Stop action is used to actually stop it from looping. You can apply the Stop
 action to any keyframe and the movie will stop playing at that exact point.

 The next code line is

  btn1. addEventListener(MouseEvent.CLICK,play1);


 This script means that btn1, our instance name, referring to the first button in
 our thumbnail gallery, is responding to a mouse click and calls for the
 functionplay1.
And here goes the definition of that function




function play1(event:MouseEvent):void{ gotoAndStop("model") }


In this line:
•function play1 tells us the name of the function;
•(event:MouseEvent) defines the type of the event , which is interaction with the
mouse here,
•void is a special type used to specify that the function doesn’t return any data;
•gotoAndStop (“model”) causes the playhead to jump to the frame model and
stops from progressing further.

All right, this is the initial script that allows our image gallery to work properly. As you
see, this piece of code repeats for the rest of the buttons, we change only instance
names and frame labels.
Step 6
To add some spice to our images when they come in, let’s learn how to animate them in
Flash CS5.

So, go up to your Images layer and select the first frame. To be able to add some
animation to our images, we need to convert them to movie clip symbols. To do this
hit F8 and select Movie Clip in the Type menu. Repeat this operation for each of the four
images. Let the names be movie1, movie2, movie3 and movie4.
Choose the Selection tool from your toolbar and double click on the first movie
clip we’ve just created. Now we can animate it.

Right click on the movie clip on the stage and select Create Motion Tween.
Step 6
To add some spice to our images when they come in, let’s learn how to animate them in
Flash CS5.

So, go up to your Images layer and select the first frame. To be able to add some
animation to our images, we need to convert them to movie clip symbols. To do this
hit F8 and select Movie Clip in the Type menu. Repeat this operation for each of the four
images. Let the names be movie1, movie2, movie3 and movie4.
You can see that it automatically inserts some frames; the number of frames inserted
depends on your frame rate. By default Flash CS4 has a frame rate of 24 frames per
second. So basically you have the number of frames that would equal one second.
Let’s cut it down to 15 frames per second – just drag the border of the 24th frame down
to the one we need.




Now let’s create a sleek fade-in effect by means of some color effects and motion
tween. Select the image on the stage while the playhead is on the last frame. Go to the
object properties, choose Alpha in the Style menu and put it 0%.
Move the playhead back and forth and you will see that we’ve created a fade-out
effect for our image – it’s completely transparent on the last keyframe. Right click
anywhere on the motion tween area and select Reverse Keyframes. Now we have the
fade-in effect applied to the picture.




Click Ctrl+Enter to test your movie. You will see that the Movie plays over and over again
and we don’t want this loop happen. Stop action comes in handy here. Return to your
movie clip window, right click on the motion tween area and select Convert to Frame by
Frame Animation. Then go to the last frame and hit F9. Type stop() in the Actions
window and that should fix the problem.
Step 7
Another cute effect we’re going to apply is rollover. Wouldn’t it be nice to have the
thumbnails change a bit when the mouse hovers over? And that’s pretty easy to do, here
we go!
                                                          Double click on the first button in the
                                                          thumbnail line, which is btn1. You can
                                                          see four frames on your timeline –
                                                           Up, Over, Down and Hit. These are the
                                                          states of our button.

                                                          •The Up frame is the inactive stage when
                                                          nothing is happening, the button is
                                                          displayed as it is.
                                                          •The Over is the stage when the mouse
                                                          hovers over the button.
                                                          •The Down frame is the stage when the
                                                          button is clicked on.
                                                          •The purpose of the Hit frame is to define
                                                          the clickable area or the coordinates of
                                                          the button.
                                                          So, insert blank keyframes (F6) into each
                                                          of the frames.
Go to the Over and select the button on the stage. In order to modify the way it is
rendered, we need to convert it into a graphic symbol. Press F8 and selectGraphic in the
Type menu. Now go to the object properties and do some changes to the color effect. You
may do whatever you want, we changed the RGB parameters, for example (see the
screenshot below).




Switch to the Down frame and apply some effects if you want the button to change its
state when you click on it. In this case, we’ve added more red to it.
Move on to the Hit area and using the Rectangular Tool draw an area you want to be
clickable on your button. Repeat this step for the other three buttons and
press Ctrl+Enter to see the result and that’s it. Now you know how to create a simple
image gallery with thumbnails and spice it with some nice effects.
How to create a simple image gallery in flash cs5

More Related Content

What's hot

Pencil animation tutorials
Pencil animation tutorialsPencil animation tutorials
Pencil animation tutorials
nataliasmile
 
Idiots guide-to-photoshop
Idiots guide-to-photoshopIdiots guide-to-photoshop
Idiots guide-to-photoshop
Marcela Conroy
 
computer 100 keyboar shortcuts
computer 100 keyboar shortcutscomputer 100 keyboar shortcuts
computer 100 keyboar shortcuts
Sreenu Munagaleti
 
How to use "PENCIL" animation software
How to use "PENCIL" animation softwareHow to use "PENCIL" animation software
How to use "PENCIL" animation software
Tanja Gvozdeva
 
Camera mouse2011manual
Camera mouse2011manualCamera mouse2011manual
Camera mouse2011manual
Kate Ahern
 

What's hot (16)

Touchevents
ToucheventsTouchevents
Touchevents
 
Scaleform Mini-Games Tutorial 1/3
Scaleform Mini-Games Tutorial 1/3Scaleform Mini-Games Tutorial 1/3
Scaleform Mini-Games Tutorial 1/3
 
Scaleform Mini-Games Tutorial 2/3
Scaleform Mini-Games Tutorial 2/3Scaleform Mini-Games Tutorial 2/3
Scaleform Mini-Games Tutorial 2/3
 
Boujou
BoujouBoujou
Boujou
 
Pencil animation tutorials
Pencil animation tutorialsPencil animation tutorials
Pencil animation tutorials
 
waagen-ecard
waagen-ecardwaagen-ecard
waagen-ecard
 
TFI_Excel 2007_pivot tables introduction
TFI_Excel 2007_pivot tables introductionTFI_Excel 2007_pivot tables introduction
TFI_Excel 2007_pivot tables introduction
 
Idiots guide-to-photoshop
Idiots guide-to-photoshopIdiots guide-to-photoshop
Idiots guide-to-photoshop
 
computer 100 keyboar shortcuts
computer 100 keyboar shortcutscomputer 100 keyboar shortcuts
computer 100 keyboar shortcuts
 
How to use "PENCIL" animation software
How to use "PENCIL" animation softwareHow to use "PENCIL" animation software
How to use "PENCIL" animation software
 
Camera mouse2011manual
Camera mouse2011manualCamera mouse2011manual
Camera mouse2011manual
 
Pf track
Pf trackPf track
Pf track
 
My text
My textMy text
My text
 
Powerpoint 2016 transitions animations timing the presentation
Powerpoint 2016 transitions animations timing the presentationPowerpoint 2016 transitions animations timing the presentation
Powerpoint 2016 transitions animations timing the presentation
 
HOW TO use PENCIL
HOW TO use PENCILHOW TO use PENCIL
HOW TO use PENCIL
 
Powerpoint class 2
Powerpoint class 2Powerpoint class 2
Powerpoint class 2
 

Viewers also liked

ActionScript 3.0 Fundamentals
ActionScript 3.0 FundamentalsActionScript 3.0 Fundamentals
ActionScript 3.0 Fundamentals
Saurabh Narula
 
Adobe photoshop about
Adobe photoshop aboutAdobe photoshop about
Adobe photoshop about
Boy Jeorge
 
Photoshop training ppt
Photoshop training pptPhotoshop training ppt
Photoshop training ppt
Brandy Shelton
 
Presentation on adobe photoshop® tools
Presentation on adobe photoshop® toolsPresentation on adobe photoshop® tools
Presentation on adobe photoshop® tools
Harshit Dave
 

Viewers also liked (16)

Actionscript 3 - Session 2 Getting Started Flash IDE
Actionscript 3 - Session 2 Getting Started Flash IDEActionscript 3 - Session 2 Getting Started Flash IDE
Actionscript 3 - Session 2 Getting Started Flash IDE
 
SkillsMatter - In-the-Brain session - What's new in ActionScript 3.0
SkillsMatter - In-the-Brain session - What's new in ActionScript 3.0SkillsMatter - In-the-Brain session - What's new in ActionScript 3.0
SkillsMatter - In-the-Brain session - What's new in ActionScript 3.0
 
Actionscript 3 - Session 4 Core Concept
Actionscript 3 - Session 4 Core ConceptActionscript 3 - Session 4 Core Concept
Actionscript 3 - Session 4 Core Concept
 
Adobe flash-cs5
Adobe flash-cs5Adobe flash-cs5
Adobe flash-cs5
 
Actionscript 3 - Session 5 The Display Api And The Display List
Actionscript 3 - Session 5 The Display Api And The Display ListActionscript 3 - Session 5 The Display Api And The Display List
Actionscript 3 - Session 5 The Display Api And The Display List
 
Actionscript 3 - Session 6 Interactivity
Actionscript 3 - Session 6 InteractivityActionscript 3 - Session 6 Interactivity
Actionscript 3 - Session 6 Interactivity
 
Actionscript 3 - Session 7 Other Note
Actionscript 3 - Session 7 Other NoteActionscript 3 - Session 7 Other Note
Actionscript 3 - Session 7 Other Note
 
Actionscript 3 - Session 3 Action Script And Flash
Actionscript 3 - Session 3 Action Script And FlashActionscript 3 - Session 3 Action Script And Flash
Actionscript 3 - Session 3 Action Script And Flash
 
Actionscript 3 - Session 1 Introduction To As 3
Actionscript 3 - Session 1 Introduction To As 3Actionscript 3 - Session 1 Introduction To As 3
Actionscript 3 - Session 1 Introduction To As 3
 
ActionScript 3.0 Fundamentals
ActionScript 3.0 FundamentalsActionScript 3.0 Fundamentals
ActionScript 3.0 Fundamentals
 
ActionScript Presentation
ActionScript PresentationActionScript Presentation
ActionScript Presentation
 
Adobe photoshop about
Adobe photoshop aboutAdobe photoshop about
Adobe photoshop about
 
Photoshop training ppt
Photoshop training pptPhotoshop training ppt
Photoshop training ppt
 
Presentation on adobe photoshop® tools
Presentation on adobe photoshop® toolsPresentation on adobe photoshop® tools
Presentation on adobe photoshop® tools
 
What slide dimensions should you use for your presentations?
What slide dimensions should you use for your presentations?What slide dimensions should you use for your presentations?
What slide dimensions should you use for your presentations?
 
Introduction to photoshop
Introduction to photoshopIntroduction to photoshop
Introduction to photoshop
 

Similar to How to create a simple image gallery in flash cs5

Flashworkshop 090317231102-phpapp01
Flashworkshop 090317231102-phpapp01Flashworkshop 090317231102-phpapp01
Flashworkshop 090317231102-phpapp01
bhavanalm
 
SFM Lesson 1
SFM Lesson 1SFM Lesson 1
SFM Lesson 1
TonyC445
 

Similar to How to create a simple image gallery in flash cs5 (20)

Button
ButtonButton
Button
 
Button
ButtonButton
Button
 
How to start a simple animation.
How to start a simple animation.How to start a simple animation.
How to start a simple animation.
 
Botones
BotonesBotones
Botones
 
𝕬𝖓𝖎𝖒𝖆𝖙𝖎𝖓𝖌 𝖙𝖊𝖝𝖙 𝖆𝖓𝖉 𝖔𝖇𝖏𝖊𝖈𝖙 𝖇𝖞 𝕽𝖔𝖓𝖊𝖑𝖑 𝕸𝖔𝖍𝖆𝖓 7𝖙𝖍 𝕭.pptx
𝕬𝖓𝖎𝖒𝖆𝖙𝖎𝖓𝖌 𝖙𝖊𝖝𝖙 𝖆𝖓𝖉 𝖔𝖇𝖏𝖊𝖈𝖙 𝖇𝖞 𝕽𝖔𝖓𝖊𝖑𝖑 𝕸𝖔𝖍𝖆𝖓 7𝖙𝖍 𝕭.pptx𝕬𝖓𝖎𝖒𝖆𝖙𝖎𝖓𝖌 𝖙𝖊𝖝𝖙 𝖆𝖓𝖉 𝖔𝖇𝖏𝖊𝖈𝖙 𝖇𝖞 𝕽𝖔𝖓𝖊𝖑𝖑 𝕸𝖔𝖍𝖆𝖓 7𝖙𝖍 𝕭.pptx
𝕬𝖓𝖎𝖒𝖆𝖙𝖎𝖓𝖌 𝖙𝖊𝖝𝖙 𝖆𝖓𝖉 𝖔𝖇𝖏𝖊𝖈𝖙 𝖇𝖞 𝕽𝖔𝖓𝖊𝖑𝖑 𝕸𝖔𝖍𝖆𝖓 7𝖙𝖍 𝕭.pptx
 
Power pointlabs quick tutorial
Power pointlabs quick tutorialPower pointlabs quick tutorial
Power pointlabs quick tutorial
 
How_to_make_ your_ quiz_interactive
How_to_make_ your_ quiz_interactiveHow_to_make_ your_ quiz_interactive
How_to_make_ your_ quiz_interactive
 
Graphical Animation - Buttons
Graphical Animation - ButtonsGraphical Animation - Buttons
Graphical Animation - Buttons
 
Flash
FlashFlash
Flash
 
Quick Step by Step Flash Tutorial
Quick Step by Step Flash TutorialQuick Step by Step Flash Tutorial
Quick Step by Step Flash Tutorial
 
Flashworkshop 090317231102-phpapp01
Flashworkshop 090317231102-phpapp01Flashworkshop 090317231102-phpapp01
Flashworkshop 090317231102-phpapp01
 
Flashworkshop 090317231102-phpapp01
Flashworkshop 090317231102-phpapp01Flashworkshop 090317231102-phpapp01
Flashworkshop 090317231102-phpapp01
 
Motion tween resize
Motion tween resizeMotion tween resize
Motion tween resize
 
GRADE 7 COMPUTER
GRADE 7 COMPUTERGRADE 7 COMPUTER
GRADE 7 COMPUTER
 
8 killer adobe photoshop tips for designers
8 killer adobe photoshop tips for designers8 killer adobe photoshop tips for designers
8 killer adobe photoshop tips for designers
 
Presentation 1
Presentation 1Presentation 1
Presentation 1
 
Realistic cast shadow effect in photoshop
Realistic cast shadow effect in photoshopRealistic cast shadow effect in photoshop
Realistic cast shadow effect in photoshop
 
M5 - Graphical Animation - Lesson 2
M5 - Graphical Animation - Lesson 2M5 - Graphical Animation - Lesson 2
M5 - Graphical Animation - Lesson 2
 
SFM Lesson 1
SFM Lesson 1SFM Lesson 1
SFM Lesson 1
 
M5 - Graphical Animation - Lesson 2
M5 - Graphical Animation - Lesson 2M5 - Graphical Animation - Lesson 2
M5 - Graphical Animation - Lesson 2
 

Recently uploaded

Top profile Call Girls In fatehgarh [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In fatehgarh [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In fatehgarh [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In fatehgarh [ 7014168258 ] Call Me For Genuine Models...
gajnagarg
 
一比一原版(WLU毕业证)罗瑞尔大学毕业证成绩单留信学历认证原版一模一样
一比一原版(WLU毕业证)罗瑞尔大学毕业证成绩单留信学历认证原版一模一样一比一原版(WLU毕业证)罗瑞尔大学毕业证成绩单留信学历认证原版一模一样
一比一原版(WLU毕业证)罗瑞尔大学毕业证成绩单留信学历认证原版一模一样
awasv46j
 
一比一定(购)西悉尼大学毕业证(WSU毕业证)成绩单学位证
一比一定(购)西悉尼大学毕业证(WSU毕业证)成绩单学位证一比一定(购)西悉尼大学毕业证(WSU毕业证)成绩单学位证
一比一定(购)西悉尼大学毕业证(WSU毕业证)成绩单学位证
eqaqen
 
怎样办理巴斯大学毕业证(Bath毕业证书)成绩单留信认证
怎样办理巴斯大学毕业证(Bath毕业证书)成绩单留信认证怎样办理巴斯大学毕业证(Bath毕业证书)成绩单留信认证
怎样办理巴斯大学毕业证(Bath毕业证书)成绩单留信认证
eeanqy
 
Top profile Call Girls In eluru [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In eluru [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In eluru [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In eluru [ 7014168258 ] Call Me For Genuine Models We ...
gajnagarg
 
Abortion pill for sale in Muscat (+918761049707)) Get Cytotec Cash on deliver...
Abortion pill for sale in Muscat (+918761049707)) Get Cytotec Cash on deliver...Abortion pill for sale in Muscat (+918761049707)) Get Cytotec Cash on deliver...
Abortion pill for sale in Muscat (+918761049707)) Get Cytotec Cash on deliver...
instagramfab782445
 
Call Girls In Ratnagiri Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service En...
Call Girls In Ratnagiri Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service En...Call Girls In Ratnagiri Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service En...
Call Girls In Ratnagiri Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service En...
Nitya salvi
 
Simple Conference Style Presentation by Slidesgo.pptx
Simple Conference Style Presentation by Slidesgo.pptxSimple Conference Style Presentation by Slidesgo.pptx
Simple Conference Style Presentation by Slidesgo.pptx
balqisyamutia
 
Resume all my skills and educations and achievement
Resume all my skills and educations and  achievement Resume all my skills and educations and  achievement
Resume all my skills and educations and achievement
210303105569
 
ab-initio-training basics and architecture
ab-initio-training basics and architectureab-initio-training basics and architecture
ab-initio-training basics and architecture
saipriyacoool
 
Jual Obat Aborsi Bandung ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan ...
Jual Obat Aborsi Bandung ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan ...Jual Obat Aborsi Bandung ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan ...
Jual Obat Aborsi Bandung ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan ...
ZurliaSoop
 

Recently uploaded (20)

Top profile Call Girls In fatehgarh [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In fatehgarh [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In fatehgarh [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In fatehgarh [ 7014168258 ] Call Me For Genuine Models...
 
一比一原版(WLU毕业证)罗瑞尔大学毕业证成绩单留信学历认证原版一模一样
一比一原版(WLU毕业证)罗瑞尔大学毕业证成绩单留信学历认证原版一模一样一比一原版(WLU毕业证)罗瑞尔大学毕业证成绩单留信学历认证原版一模一样
一比一原版(WLU毕业证)罗瑞尔大学毕业证成绩单留信学历认证原版一模一样
 
Jordan_Amanda_DMBS202404_PB1_2024-04.pdf
Jordan_Amanda_DMBS202404_PB1_2024-04.pdfJordan_Amanda_DMBS202404_PB1_2024-04.pdf
Jordan_Amanda_DMBS202404_PB1_2024-04.pdf
 
Q4-W4-SCIENCE-5 power point presentation
Q4-W4-SCIENCE-5 power point presentationQ4-W4-SCIENCE-5 power point presentation
Q4-W4-SCIENCE-5 power point presentation
 
Independent Escorts Goregaon WhatsApp +91-9930687706, Best Service
Independent Escorts Goregaon WhatsApp +91-9930687706, Best ServiceIndependent Escorts Goregaon WhatsApp +91-9930687706, Best Service
Independent Escorts Goregaon WhatsApp +91-9930687706, Best Service
 
Furniture & Joinery Details_Designs.pptx
Furniture & Joinery Details_Designs.pptxFurniture & Joinery Details_Designs.pptx
Furniture & Joinery Details_Designs.pptx
 
一比一定(购)西悉尼大学毕业证(WSU毕业证)成绩单学位证
一比一定(购)西悉尼大学毕业证(WSU毕业证)成绩单学位证一比一定(购)西悉尼大学毕业证(WSU毕业证)成绩单学位证
一比一定(购)西悉尼大学毕业证(WSU毕业证)成绩单学位证
 
怎样办理巴斯大学毕业证(Bath毕业证书)成绩单留信认证
怎样办理巴斯大学毕业证(Bath毕业证书)成绩单留信认证怎样办理巴斯大学毕业证(Bath毕业证书)成绩单留信认证
怎样办理巴斯大学毕业证(Bath毕业证书)成绩单留信认证
 
Gamestore case study UI UX by Amgad Ibrahim
Gamestore case study UI UX by Amgad IbrahimGamestore case study UI UX by Amgad Ibrahim
Gamestore case study UI UX by Amgad Ibrahim
 
Top profile Call Girls In eluru [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In eluru [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In eluru [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In eluru [ 7014168258 ] Call Me For Genuine Models We ...
 
Mohanlalganj ! Call Girls in Lucknow - 450+ Call Girl Cash Payment 9548273370...
Mohanlalganj ! Call Girls in Lucknow - 450+ Call Girl Cash Payment 9548273370...Mohanlalganj ! Call Girls in Lucknow - 450+ Call Girl Cash Payment 9548273370...
Mohanlalganj ! Call Girls in Lucknow - 450+ Call Girl Cash Payment 9548273370...
 
Abortion pill for sale in Muscat (+918761049707)) Get Cytotec Cash on deliver...
Abortion pill for sale in Muscat (+918761049707)) Get Cytotec Cash on deliver...Abortion pill for sale in Muscat (+918761049707)) Get Cytotec Cash on deliver...
Abortion pill for sale in Muscat (+918761049707)) Get Cytotec Cash on deliver...
 
Call Girls In Ratnagiri Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service En...
Call Girls In Ratnagiri Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service En...Call Girls In Ratnagiri Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service En...
Call Girls In Ratnagiri Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service En...
 
NO1 Top Pakistani Amil Baba Real Amil baba In Pakistan Najoomi Baba in Pakist...
NO1 Top Pakistani Amil Baba Real Amil baba In Pakistan Najoomi Baba in Pakist...NO1 Top Pakistani Amil Baba Real Amil baba In Pakistan Najoomi Baba in Pakist...
NO1 Top Pakistani Amil Baba Real Amil baba In Pakistan Najoomi Baba in Pakist...
 
Pondicherry Escorts Service Girl ^ 9332606886, WhatsApp Anytime Pondicherry
Pondicherry Escorts Service Girl ^ 9332606886, WhatsApp Anytime PondicherryPondicherry Escorts Service Girl ^ 9332606886, WhatsApp Anytime Pondicherry
Pondicherry Escorts Service Girl ^ 9332606886, WhatsApp Anytime Pondicherry
 
Simple Conference Style Presentation by Slidesgo.pptx
Simple Conference Style Presentation by Slidesgo.pptxSimple Conference Style Presentation by Slidesgo.pptx
Simple Conference Style Presentation by Slidesgo.pptx
 
Just Call Vip call girls Kasganj Escorts ☎️8617370543 Two shot with one girl ...
Just Call Vip call girls Kasganj Escorts ☎️8617370543 Two shot with one girl ...Just Call Vip call girls Kasganj Escorts ☎️8617370543 Two shot with one girl ...
Just Call Vip call girls Kasganj Escorts ☎️8617370543 Two shot with one girl ...
 
Resume all my skills and educations and achievement
Resume all my skills and educations and  achievement Resume all my skills and educations and  achievement
Resume all my skills and educations and achievement
 
ab-initio-training basics and architecture
ab-initio-training basics and architectureab-initio-training basics and architecture
ab-initio-training basics and architecture
 
Jual Obat Aborsi Bandung ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan ...
Jual Obat Aborsi Bandung ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan ...Jual Obat Aborsi Bandung ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan ...
Jual Obat Aborsi Bandung ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan ...
 

How to create a simple image gallery in flash cs5

  • 1. How To Create A Simple Image Gallery In Flash CS5 Prepared by: Lyndon Jeorge A. Mendoza
  • 2. Overview In this tutorial we will show you how to create an simple image gallery with thumbnails in Flash CS5. We will apply a couple of simple, yet nice transitions to the images and thumbnails. This will require you to get the hands a bit dirty in animation and action scripting. However, this is going to be easy and fun! So here we go.
  • 3. Step 1 Create a new file with ActionScript 3.0 and modify the document like it’s shown on the screenshot below. You can enter the document properties via the admin panel (follow the highlights in red) or pressing Ctrl+J.
  • 4. Step 2 Add four images from your computer to your library. To do this press File => Imort => Import to library. You can also import the images directly to the stage, by pressing Ctrl+R. Next, create three new layers and give them the names Buttons, Images and Actions. To rename a layer, double click on it and type the text. See the shot below.
  • 5. Notice that the first frame of each layer has a small circle on it. This is a blank keyframe. Once you put anything on the stage, the circle transforms into black dot which corresponds to the filled keyframe. Go to the Buttons layer and select the first frame on the timeline. Drag the images from your library to the stage (in case you haven’t imported them right to the stage already) and modify their size to 114×85 px. Be sure to drag the images to our document area which we’ve made black earlier.
  • 6. Now you have your thumbnails on the stage. Set image alignment selecting Align in Window menu, or just press Ctrl+K. Align pics to the bottom and distribute horizontal center like it’s shown below.
  • 7. Step 3 Our thumbnails are going to be buttons, so now we need to convert the images into the Button symbols. Using the Selection Tool, right click on the first thumbnail image and choose “Convert to Symbol”, or simply hit F8. In the opened window set the type Button and name the symbol btn1. Click “OK” to save the changes. Do this for the other three images and give them the names btn2, btn3 and btn4, respectively.
  • 8. Now we have to give each of these the same Instance Name which is a name to refer to your symbol or object in ActionScript. Instance Name can be set in the Properties panel which you can enter by selecting the necessary object on the stage. Instance Name of the btn1 button will be btn1 and so forth. Right click on the first frame of the Buttons layer, select Copy Frames, go to the fourth frame and Paste Frames the same way. Or you can just drag the first frame up to the fourth cell to copy it. You timeline should have the following look by now.
  • 9. Step 4 OK, let’s put the images that we will be exactly viewing in our gallery. Switch to the Images layer and select the first frame on the timeline. Drag the image that corresponds to the first thumbnail from your library to the stage. Size it down to the 358×268 px and set its position to the 93×18. Of course, you may set your own dimensions and place the pictures whatever you like; this is just what we use for this tutorial. Insert three more blank keyframes (F6) and do the same operation with the rest of the images.
  • 10. Now go back to the timeline, select the first frame and go to the Properties panel. Here we will set the Frame Label. It’s important to remember about this because we’re going to reference frame labels in the ActionScript later. We’ve got four frame labels: model, dreamy, dancing and teacher, respectively.
  • 11. Step 5 So far we’ve got a thumbnail gallery where each of the thumbs is a button. Our next step is to add some action script so we could click on the button to play the right frame. Go to the Actions layer and drag the first frame up to the fourth cell. Your timeline should have the following look by this moment:
  • 12. Go back to the first frame in the Actions layer and hit F9 to open the Actions window. Copy and paste the following code into your Actions window. Don’t worry, we will explain in great detail what happens shortly. stop(); btn1.addEventListener(MouseEvent.CLICK,play1); function play1(event:MouseEvent):void{ gotoAndStop ("young") } btn2.addEventListener(MouseEvent.CLICK,play2); function play2(event:MouseEvent):void{ gotoAndStop ("thoughtful") } btn3.addEventListener(MouseEvent.CLICK,play3); function play3(event:MouseEvent):void{ gotoAndStop ("dancing") } btn4.addEventListener(MouseEvent.CLICK,play4); function play4(event:MouseEvent):void{ gotoAndStop ("old") }
  • 13. After you have copied and pasted the above code, go to Control => Test Movie or press Ctrl + Enter to see the result gallery. Here is what you should get:
  • 14. Let’s look closer at what you’ve just done and learn more about AS functions. The first thing you see in your code window is Stop action. Stop(); Any effect you create in Flash repeats continuously when you test or publish your movie. Stop action is used to actually stop it from looping. You can apply the Stop action to any keyframe and the movie will stop playing at that exact point. The next code line is btn1. addEventListener(MouseEvent.CLICK,play1); This script means that btn1, our instance name, referring to the first button in our thumbnail gallery, is responding to a mouse click and calls for the functionplay1.
  • 15. And here goes the definition of that function function play1(event:MouseEvent):void{ gotoAndStop("model") } In this line: •function play1 tells us the name of the function; •(event:MouseEvent) defines the type of the event , which is interaction with the mouse here, •void is a special type used to specify that the function doesn’t return any data; •gotoAndStop (“model”) causes the playhead to jump to the frame model and stops from progressing further. All right, this is the initial script that allows our image gallery to work properly. As you see, this piece of code repeats for the rest of the buttons, we change only instance names and frame labels.
  • 16. Step 6 To add some spice to our images when they come in, let’s learn how to animate them in Flash CS5. So, go up to your Images layer and select the first frame. To be able to add some animation to our images, we need to convert them to movie clip symbols. To do this hit F8 and select Movie Clip in the Type menu. Repeat this operation for each of the four images. Let the names be movie1, movie2, movie3 and movie4.
  • 17. Choose the Selection tool from your toolbar and double click on the first movie clip we’ve just created. Now we can animate it. Right click on the movie clip on the stage and select Create Motion Tween.
  • 18. Step 6 To add some spice to our images when they come in, let’s learn how to animate them in Flash CS5. So, go up to your Images layer and select the first frame. To be able to add some animation to our images, we need to convert them to movie clip symbols. To do this hit F8 and select Movie Clip in the Type menu. Repeat this operation for each of the four images. Let the names be movie1, movie2, movie3 and movie4.
  • 19. You can see that it automatically inserts some frames; the number of frames inserted depends on your frame rate. By default Flash CS4 has a frame rate of 24 frames per second. So basically you have the number of frames that would equal one second. Let’s cut it down to 15 frames per second – just drag the border of the 24th frame down to the one we need. Now let’s create a sleek fade-in effect by means of some color effects and motion tween. Select the image on the stage while the playhead is on the last frame. Go to the object properties, choose Alpha in the Style menu and put it 0%.
  • 20. Move the playhead back and forth and you will see that we’ve created a fade-out effect for our image – it’s completely transparent on the last keyframe. Right click anywhere on the motion tween area and select Reverse Keyframes. Now we have the fade-in effect applied to the picture. Click Ctrl+Enter to test your movie. You will see that the Movie plays over and over again and we don’t want this loop happen. Stop action comes in handy here. Return to your movie clip window, right click on the motion tween area and select Convert to Frame by Frame Animation. Then go to the last frame and hit F9. Type stop() in the Actions window and that should fix the problem.
  • 21. Step 7 Another cute effect we’re going to apply is rollover. Wouldn’t it be nice to have the thumbnails change a bit when the mouse hovers over? And that’s pretty easy to do, here we go! Double click on the first button in the thumbnail line, which is btn1. You can see four frames on your timeline – Up, Over, Down and Hit. These are the states of our button. •The Up frame is the inactive stage when nothing is happening, the button is displayed as it is. •The Over is the stage when the mouse hovers over the button. •The Down frame is the stage when the button is clicked on. •The purpose of the Hit frame is to define the clickable area or the coordinates of the button. So, insert blank keyframes (F6) into each of the frames.
  • 22. Go to the Over and select the button on the stage. In order to modify the way it is rendered, we need to convert it into a graphic symbol. Press F8 and selectGraphic in the Type menu. Now go to the object properties and do some changes to the color effect. You may do whatever you want, we changed the RGB parameters, for example (see the screenshot below). Switch to the Down frame and apply some effects if you want the button to change its state when you click on it. In this case, we’ve added more red to it. Move on to the Hit area and using the Rectangular Tool draw an area you want to be clickable on your button. Repeat this step for the other three buttons and press Ctrl+Enter to see the result and that’s it. Now you know how to create a simple image gallery with thumbnails and spice it with some nice effects.