Adobe Flash for Beginners - Photo and Video Galleries
Class Description: Get your digital media collections online easily with the power of XML. Create both a basic photo slideshow and gallery (with buttons and captions) designed with rapid future image additions and subtractions in mind. Take advantage of built-in Flash components while building an interactive video gallery. Consolidate your work by building a composite Flash project made up of multiple Flash files. Learn ways to share collections of digital media with the web.
1. Important Settings for Class
Exercise 1a: Loading an External Image via the UILoader Component
Exercise 1b. Creating an Animated Compass Rose
Exercise 1c. Loading the External, Animated Compass Rose .swf
Exercise 2a: Creating a Timeline Frame by Frame Photo Slideshow
Exercise 2b: Creating a Timeline Tweened Photo Slideshow
Exercise 3: Using Buttons to Load External Images and Dynamic Text
Exercise 4 - Thumbnail Video Gallery (FLVPlayback and Buttons)
Exercise 5 - ActionScript 3.0 XML Video Gallery (FLVPlayback and List Component)
Instructor: Bill Morrison
Wednesday, November 4, 2009 • 6:00pm-9:00pm • 1 mtg
UHM Sakamaki C104, Manoa MultiMedia Lab • Pacific New Media
1. Important Settings for Class
- Reset the Flash workspace - Window > Workspace > Classic and/or Window > Workspace > Reset 'Classic'
- Set the Drawing Mode to Object Drawing in the Toolbar
- Under Flash Preferences for ActionScript - set keywords to bright Red
Exercise 1a: Loading an External Image via the UILoader Component
In this exercise we will create a 'host' .swf file which loads an external .jpg at runtime. Runtime equals when the 'host' .swf is viewed (by the world) in a web browser via the Flash Player. By loading the image externally, we gain the ability to update the .jpg without having to re-edit the master .swf.
Step by Step »
- From the Menu Bar (File > New) or the Welcome Screen (if visible), create a new, Actionscript 3.0 file
- Save your file as islands-ex1.fla
- In the Toolbar, select the Selection Tool
- With nothing selected, in the Properties Panel, set the frame rate to 12
- This frame rate is being set to prove a point later on in the class
- Re-name 'Layer 1' to 'islands'
- In the 'islands' layer timeline, select Blank Keyframe 1
- From the Menu Bar, go to Window > Components
- Open the User Interface section
- Note: there are many free 'components' that come with Flash
- components are 'pre-made bundles of functionality'
- some components are 'skinned' - i.e. they have parts that are visible
- other components are invisible until you load something into them
- you can get additional free components from Yahoo, the Adobe Flash Exchange and elsewhere
- them buy them at places like flashloaded.com, Flashcomponents.net and elsewhere
- Drag an Instance of the UILoader to the stage
- With the UILoader selected, in the Properties Panel, set the UILoader size to W: 654 and H: 447
- Note: These are not 'magic' numbers...they are the pixel counts of the .jpg we plan to load
- With nothing selected, in the Properties Panel, click the Edit: button
- Choose Contents to snap the stage of the size to the size of the UILoader
- Save your file
- Test your movie
- From the Menu Bar, go to Window > Component Inspector
- Select the UILoader
- In the Component Inspector, set the source for the UILoader to hi-islands.jpg
- Lock the 'islands' layer
- Save your file
- Test your movie
- DEMO: changing the look of the hi-islands.jpg with Photoshop
Exercise 1b. Creating an Animated Compass Rose
Step by Step »
- From the Menu Bar (File > New) or the Welcome Screen (if visible), create a new, Actionscript 3.0 file
- Save your file as compass-ex1.fla
- In the Toolbar, select the Selection Tool
- With nothing selected, in the Properties Panel, set the frame rate to 25
- We will be tweening - 25 is a good fame rate for tweened animations
- In the Timeline, select Blank Keyframe 1
- In the Menu Bar, go to File > Import to Stage
- Import compass-rose.ai
- Demo: the compass-rose.ai in Adobe Illustrator
- In the Import to Stage dialogue box:
- set the compass-rose layer to be imported as a Movie Clip
- Convert Layers to: Flash Layers
- Check: Place objects at original position
- Check: Set stage size to same as Illustrator artboard/crop area...
- Once imported, select the compass rose
- In the Properties panel, confirm that the compass rose is a Movie Clip (instance)
- From the Menu Bar go to Zoom > Magnification > 100%
- On the 'compass-rose' layer, insert a keyframe into frame 75
- Notice that Flash has auto-copied the contents of the Keyframe 1 frame into Keyframe 75
- Right-click in any frame between 1 and 75 and choose Create Classic Tween
- Save your file
- Test your movie
- In the Timeline of the 'compass-rose' layer, select Keyframe 1
- In the Properties Panel, apply a CW rotation of 1 to the Motion Tween
- In the Properties Panel, apply an Easing value of 100 to the Motion Tween
- Save your file
- Test your movie
- Select the Instance of the compass-rose in Keyframe 1
- In the Properties Panel, in the Color Effect section, under the Style: drop down, choose Alpha
- Set the Alpha to 0%
- Select the Instance of the compass-rose in Keyframe 75
- In the Filters Panel, apply a Drop Shadow filter - style to taste
- Lock the 'compass-rose' layer
- Save your file
- Test your movie
- Create a new layer and re-name it 'actions'
- Move the 'actions' layer to the top of the layer stack
- Lock the 'actions' layer
- NOTE: you can add ActionScript code to locked 'actions' layer
- On the 'actions' layer, insert a Keyframe into frame 75
- Note: if there is no content in the preceding keyframe, there is no auto-copy (i.e. you get a blank keyframe)
- From the Menu bar go to Window > Actions
- Demo: stop(); the animation
- In Blank Keyframe 1 of the 'actions' layer, type the 'In Keyframe 1' code (see below) into the Actions Panel
- ActionScript is a hyper-sensitive language - spelling and case- sensitivity count
- In Blank Keyframe 75 of the 'actions' layer, type the 'In Keyframe 75' code (see below) below into the Actions Panel
- Demo: checking your code (Check syntax)
- Demo: auto-formatting your code
- Save your file
- Test your movie

For a complete explanation of this code (and more) go here
Exercise 1c. Loading the External, Animated Compass Rose .swf
Step by Step »
- Flip back to the islands-ex1.fla file
- From the Menu bar go to File > Save As - save your file as combo-ex1.fla
- In the Toolbar, select the Selection Tool
- From the Menu Bar go to Zoom > Magnification > 100%
- Create a New Layer and re-name it 'compass-rose'
- Keep your 'actions' as the topmost layer
- In the 'compass-rose' layer timeline, select Blank Keyframe 1
- From the Library, drag out an Instance of the UILoader to the stage lower left
- Note: While the first Instance of a Flash Component can add a signification chuck to the .swf file size, additional Instances of the same component will not add much more
- With the UILoader selected, in the Properties Panel, set the UILoader size to W: 210 and H: 210
- Reposition your UILoader to taste
- From the Menu Bar go to Window > Component Inspector
- Select the UILoader
- In the Component Inspector, set the source for the UILoader to compass-ex1.swf and scaleContent to true
- Save your file
- Test your movie
- You will notice two problems: speed and scale
- NOTE: Loaded .swf files, in most cases, inherit the parent .fla's frame rate
- With nothing selected, in the Properties Panel, set the frame rate of combo-ex1.fla to 25
- With the UILoader selected, in the Component Inspector, set scaleContent to false
- Save your file
- Test your movie
- Demo: scaling the UILoader
- Demo: changing the Aspect Ratio
- Demo: editing the source .swf
- Visit: http://labs.adobe.com/
Exercise 2a: Creating a Timeline Frame by Frame Photo Slideshow
In this exercise you will create a simple Frame by Frame Photo Slideshow. The different slides will be organized in Photoshop then imported into Flash.
Step by Step »
- From the Menu Bar (File > New) or the Welcome Screen (if visible), create a new, Actionscript 3.0 file
- In the Properties Panel, set the Frame Rate to 25
- This frame rate is being set to prove a point later on in this exercise
- Save your file as ex-2a.fla
- From the Menu Bar, go to File > Import to Stage
- Import slovenia-frame-by-frame.psd
- Demo: the slovenia-frame-by-frame.psd in Photoshop
- In the Import to Stage dialogue box:
- Convert Layers: Keyframes
- check - Place layers at original position
- check - Set stage size to same as Photoshop canvas...
- Delete the leftover layer
- Save your file
- Test your movie
- In the Properties Panel, set the Frame Rate to 1
- Note: you can go lower than 1 but I do not recommend it
- With your Frame Rate set to 1, add extra frames (create frames spans) after each slide frame until you achieve you desired speed
- Save your file
- Test your movie
- Create a new layer and name it 'effect'
- Be sure this layer is on the top of the layer stack
- In the 'effect' layer timeline, select Blank Keyframe 1
- In the Toolbar, select the Rectangle Tool
- Prior to drawing, in the Tool Bar, set the following:
- be sure to define a fill color (for example, red)
- turn the stroke off
- With the Rectangle Tool, click and drag a rectangle on your stage
- Don't worry about the size - we'll take care of that next
- In the Toolbar, select the Selection Tool
- Select the rectangle
- From the Menu Bar, go to Window > Align
- In the Align Panel, be sure to click To stage:
- Click the Match width and height button - Your rectangle resizes to match the stage
- To align your rectangle to the stage, click the Align horizontal center button and the Align vertical center button
- Select your rectangle, right-click and choose Convert to Symbol
- In the Convert to Symbol dialogue box, set the following:
- choose Type: Movie Clip
- With the rectangle (movie clip) selected, go to the Filters section of the the Properties Panel
- At the bottom of the Filters section, click the "Add filter' icon and choose Drop Shadow
- Turn on the Knockout and Inner Shadow checkboxes - Style the Drop Shadow Filter to taste
- Save your file
- Test your movie
- Move the 'effect' layer to the bottom of the layer stack
- Select the rectangle
- In the Properties panel, turn off the Knockout and Inner Shadow checkboxes - Style the Drop Shadow Filter to taste
- Save your file
- Test your movie
- In the Properties Panel, hit the Edit button and choose Contents to include the drop shadow
- Save your file
- From the Menu Bar go to File > Publish Preview > HTML
Exercise 2b: Creating a Timeline Tweened Photo Slideshow
In this exercise you will create a simple tweened (alpha transition) photo slideshow. The different slides will be organized in Photoshop then imported into Flash.
Step by Step »
- From the Menu Bar (File > New) or the Welcome Screen (if visible), create a new, Actionscript 3.0 file
- In the Properties Panel, set the Frame Rate (FPS) to 25
- Note: 25 gives us smooth tweens
- Save your file as ex-2b.fla
- In the Toolbar, select the Selection Tool
- From the Menu Bar, go to File > Import > Import to Stage
- Choose slovenia-tween.psd as the file you want to Import
- In the .PSD Import dialogue box, set the following:
- Convert Layers to: Flash Layers
- check 'Place objects at original position'
- check 'Set stage size to same size...'
- check Create Movie Clips for these Layers
- Be sure the layer is set to Lossy
- Delete the leftover layer
- In frame 225 of layer 'c', right-click and choose 'Insert Keyframe'
- Notice that Flash has auto-copied the contents of the Keyframe 1 frame into Keyframe 225
- Lock the 'c' layer
- Select the Keyframe in Layer 'b' - then let go of the mouse
- Select and drag the Keyframe to frame 25
- In frame 50 of layer 'b', right-click and choose 'Insert Keyframe'
- In frame 100 of layer 'b', right-click and choose 'Insert Keyframe'
- In frame 125 of layer 'b', right-click and choose 'Insert Keyframe'
- Select the Keyframe in Layer 'a' - then let go of the mouse
- Select and drag the Keyframe to frame 100
- In frame 125 of layer 'a', right-click and choose 'Insert Keyframe'
- In frame 175 of layer 'a', right-click and choose 'Insert Keyframe'
- In frame 200 of layer 'a', right-click and choose 'Insert Keyframe'
- Save your file
- Test your movie
- In each of the four, 25 frame transition zones, select a frame, right-click and choose Create Classic Tween
- Save your file
- Test your movie
- Select frame 50 of layer 'b'
- Select the image (Movie Clip Instance) in Keyframe 50 of layer 'b'
- In the Properties Panel, in the Color Effect section, under the Style: drop down, choose Alpha
- Set the Alpha to 0%
- Select frame 125 of layer 'b'
- Select the image (Movie Clip Instance) in Keyframe 125 of layer 'b'
- In the Properties Panel, in the Color Effect section, under the Style: drop down, choose Alpha
- Set the Alpha to 0%
- Select frame 125 of layer 'a'
- Select the image (Movie Clip Instance) in Keyframe 125 of layer 'a'
- In the Properties Panel, in the Color Effect section, under the Style: drop down, choose Alpha
- Set the Alpha to 0%
- Select frame 200 of layer 'a'
- Select the image (Movie Clip Instance) in Keyframe 200 of layer 'a'
- In the Properties Panel, in the Color Effect section, under the Style: drop down, choose Alpha
- Set the Alpha to 0%
- Save your file
- Test your movie
- Save your file as ex-2c.fla
- Choose slovenia-extra.psd as the file you want to Import
- In the .PSD Import dialogue box, set the following:
- Nothing - just bring the bitmaps in
- Open the Library
- Find the Movie Clips making up the current slideshow
- Double-click to edit the first Movie Clip
- Once inside the Movie Clip - select the bitmap image
- In the Properties Panel - click the Swap button
- Chose the first 'extra' image
- Return to Scene 1
- Repeat this swap process for the other 2 images
- Save your file
- Test your movie
- Demo: Adding Captions
- Demo: Export video
Exercise 3: Using Buttons to Load External Images and Dynamic Text
In this exercise you will create a custom, thumbnail photo gallery. The overall gallery design was created in Photoshop. We will leverage the layers of the .psd file as they are imported into Flash. ActionScript 3.0 will be used to connect user mouse-clicks to the loading of external .jpgs into a UILoader component. A sound effect will be added to one of the buttons.
Step by Step »
- From the Menu Bar (File > New) or the Welcome Screen (if visible), create a new, Actionscript 3.0 file
- Save your file as ex-3.fla
- From the Menu Bar, go to File > Import to Stage
- Import sharks-layout.psd
- Demo: the sharks-layout.psd in Photoshop
- In the Import to Stage dialogue box:
- make sure the text layer is set to Editable text
- set the border and buttons layers to Bitmap image with editable layer styles
- make sure the border and buttons layers are imported as Movie Clip Symbols
- Convert Layers: Flash Layers
- check - Place layers at original position
- check - Set stage size to same as Photoshop canvas...
- Save your file
- Test your movie
- Lock the 'cool-border' and 'layout-helpers' layers
- Select the Sharks of Hawai'i text and apply a Drop Shadow Filter - style to taste
- Lock the 'SHARKS OF HAWAI'I' layer
- Save your file
- Select the top left image thumbnail (Movie Clip Instance) and apply a Drop Shadow Filter - style to taste
- While in the Filters Panel, copy the Drop Shadow Filter effect
- Select the remaining 5 thumbnail images (Instances)
- In the Filters Panel, paste the Drop Shadow Filter effect
- Working from left to right, top to bottom, turn each thumbnail into a button symbol
- With an thumbnail selected, hit <F8> to bring up the Convert to Symbol dialogue box
- name your buttons btn1 to btn6
- Working from left to right, top to bottom, edit each button symbol by:
- Select the button, right-click and choose 'Edit in Place'
- add an Over state keyframe <F6> to each button
- remove the Drop Shadow effect from the Over state
- return to the main Timeline (Scene 1)
- Move on the the next button
- Save your file
- Test your movie
- Working from left to right, top to bottom, give each thumbnail button symbol an Instance Name of btn1 to btn6
- Lock all of the thumbnail button layers
- Save your file
- Test your movie
- Highlight the 'layout-helpers' layer
- Add a new layer and rename it 'UILoader'
- Select the Blank keyframe of the 'UILoader' layer
- From the Menu Bar, go to Window > Components
- Open the User Interface section
- With the 'UILoader' layer highlighted, drag an Instance of the UILoader to the stage
- With the UILoader selected, in the Properties Panel, set the UILoader size to W: 260 and H: 260
- Align the UILoader with the 'helper' graphic
- Demo: Flash has numerous snapping options
- Select the UILoader
- In Component Inspector, set the source of the UILoader to '1.jpg'
- Save your file
- Test your movie
- With the UILoader selected, give it an Instance Name of 'myImageLoader'
- Lock the 'UILoader' layer
- Save your file
- Test your movie
- With the 'UILoader' layer highlighted, add a New Layer and rename it 'captions'
- Select the Text Tool and in the Properties Panel, set the following:
- Type: Dynamic Text
- Font: _sans
- Color: #333333
- Size: 14
- Justify: Right
- Single line
- Drag a Text Box over the text box 'helper' graphic - position to taste
- With the Text Box selected, give it an Instance Name of 'myTextBox'
- Lock the 'captions' layer
- Hide the visibility of the 'layout-helpers' layer
- Save your file
- Test your movie
- From the Menu Bar go to File > Publish Settings
- under the Flash tab, turn off "Export hidden layers'
- as an alternative you can turn the 'layout-helpers' into guide layer (right-click on the layer and choose)
- Add a new layer and re-name it 'actions'
- Move the 'actions' layer to the top of the layer stack
- Lock the 'actions' layer
- Select the Blank Keyframe in the 'actions' layer
- In the Menu bar, go to File > Open - open the flash-03.as
- Drag through (select) then copy (cmd/ctrl + c) the shark-gallery code
- Flip back to the ex-2.fla
- From the Menu Bar go to Window > Actions to open the Actions Panel
- Into the Blank Keyframe of the 'actions' layer, paste (cmd/ctrl + v) the code into the Actions Panel
- note the ActionScript symbol in the Blank Keyframe
- Save your file
- Test your movie
- Demo: changing the Text Box font
- Demo: changing the text that is loaded
Let's have a quick look at the ActionScript 3.0 code you applied:
B. Adding a Sound Effect to the Great White Shark Image
Step by Step »
- From the Menu Bar, go to File > Import to Library
- Import scream.wav
- In the Library, right click scream.wav and choose Linkage...
- Click the Export for ActionScript box and in the Class: field enter 'scream'
- Open the Actions Panel (Window > Actions)
- Select the keyframe of the 'actions' layers that contains your shark gallery code
- Manually type in the 2 extra lines of code in the 'loadImage3' function that appear after ..."Great White Shark"; in the image below
- Save your file
- Test your movie
- Demo: changing the mouse Click to a roll_over action

Exercise 4 - Thumbnail Video Gallery (FLVPlayback & Buttons)
In the exercise we will build a Thumbnail Video Gallery driven by invisible button clicks. We will import a background image to set the mood and to provide a visual guides for button placement. ActionScript 3.0 will be used to link the buttons to the loading of three, different Flash Videos (.flv). Inspiration for this gallery was found here. The videos used in this exercise came from archive.org
Step by Step »
- Create a new ActionScript 3.0 file
- Save your file as ex-4.fla
- In the Toolbar, select the Selection Tool
- From the Menu Bar, go to File > Import to Stage
- Import commercials.psd
- Demo: the commercials.psd in Photoshop
- In the Import dialogue box set the following:
- Convert Layers: Flash Layers
- check 'Place layers at original position'
- check 'Set stage size to same as Photoshop canvas'
- Lock the 'video-background' layer
- Save your file
- Create a new layer and re-name it 'buttons'
- Select the Blank keyframe of the 'buttons' layer
- In the Tool Bar, select the Rectangle Tool
- In the Properties Panel (prior to drawing), set the following:
- fill color to bright green with an alpha value of 60%
- stroke to none
- Draw a rough rectangle around the Ole Virginia thumbnail
- In the Toolbar, select the Selection Tool
- Select the rectangle
- In the Properties Panel, set the rectangle size to W: 140 and H: 110
- Center the rectangle over the Ole Virginia thumbnail
- Select the rectangle, right-click and choose Covert to symbol
- In the Convert to Symbol dialogue box, set the following:
- choose Type: Button
- enter 'btn-thumb' for the name
- On the stage, right-click the Instance of 'btn-thumb' and choose Edit in Place
- To create an invisible button do the following:
- click the Up keyframe and release the mouse
- click and drag the Up state Keyframe to the Hit state
- Return to the Main Timeline (Scene 1)
- the cyan color you see is your invisible, hotspot button
- Save your file
- Test you Movie
- From the Library, drag two more instances of 'btn-thumb' to cover the two other image thumbnails
- Use the Align Panel to align the three buttons
- From top to bottom, give the following Instance Names to your buttons: btn1, btn2, btn3
- Lock the 'buttons' layer
- Save your file
- Test you Movie
- Create a new layer and re-name it 'video-player'
- Select the Blank keyframe of the 'video-player' layer
- From the Menu Bar go to Window > Components
- Open the Video section
- Drag an Instance of the FLVPlayback component to the stage
- Select the FLVPlayback component
- In the Properties Panel, set the following (for your FLVPlayback component):
- W: 320
- H: 240
- X: 280
- Y: 150
- From the Menu Bar go to Window > Component Inspector
- Select the FLVPlayback component
- In the Component Inspector, set the following:
- Skin: SkinUnderPlayStopSeekMuteVol.swf
- SkinBackgroundColor: #658A4F
- In the Properties Panel, give the FLVPlayback component an Instance Name of 'myVideoPlayer'
- Lock the 'video-player' layer
- Save your file
- Test your Movie
- Add a new layer and re-name it 'actions'
- Move the 'actions' layer to the top of the layer stack
- Lock the 'actions' layer
- In the Menu bar, go to File > Open - open the flash-03.as
- Drag through (select) then copy (cmd/ctrl + c) the Thumbnail Video Gallery code
- Flip back to the ex-4.fla
- From the Menu Bar go to Window > Actions to open the Actions Panel
- Into the Blank Keyframe of the 'actions' layer, paste (cmd/ctrl + v) the code into the Actions Panel
- note the ActionScript symbol in the Blank Keyframe
- Save your file
- Test your movie
- Demo: changing the autoPlay and autoRewind values
Exercise 5 - ActionScript 3.0 XML Video Gallery (FLVPlayback & List Component)
In this exercise we will build a xml Flash Video Gallery. ActionScript 3.0 will be used to connect two components to an external xml file that contains links to a series of Flash Videos (.flv) and their associated captions. We will import a background image to set the mood for the piece. The videos used in this exercise came from archive.org
Step by Step »
- Create a new ActionScript 3.0 file.
- Save your file as ex-5.fla
- In the Toolbar, select the Selection Tool
- From the Menu Bar go to File > Import to Stage
- Import superman.psd
- Demo: the commercials.psd in Photoshop
- In the Import to Stage dialogue box:
- set the image layer to Bitmap image with editable layer styles
- Convert Layers: Flash Layers
- check - Place layers at original position
- check - Set stage size to same as Photoshop canvas
- Select the superman-bk instance
- In the Filters Panel, add the following:
- Gradient Glow filter - season to taste
- Adjust Color filter - desaturate the image - to taste
- With nothing selected, in the Properties Panel, change the stage color to a color taken from the image
- Lock the 'superman-bk' layer
- Save your file
- Test your movie
- Create a new layer and re-name it 'components'
- Select the Blank keyframe of the 'components' layer
- From the Menu Bar go to Window > Components
- Open the Video section
- Drag an Instance of the FLVPlayback component to the stage
- Select the FLVPlayback component
- In the Properties panel, set the FLVPlayback size to W: 320 and H: 240
- From the Menu Bar go to Window > Component Inspector
- Select the FLVPlayback component
- In the Component Inspector, set the following:
- Skin: SkinUnderPlayStopSeekMuteVol.swf
- SkinBackgroundColor: #666666
- Position the FLVPlayback component to left side of the hole in the superman-bk image
- Give the FLVPlayback an Instance Name of 'vid'
- Save your file
- From the Menu Bar go to Window > Components
- Expand the User Interface section
- Drag an Instance of the List component to the stage
- Position the List component so it sits to the right of the FLVPlayback component
- In the Properties panel, set the List component size to W: 180 by H: 220
- Give the List component an Instance Name of 'vidSelect'
- Lock the 'components' layer
- Save your file
- Add a new layer and re-name it 'actions'
- Move the 'actions' layer to the top of the layer stack
- Lock the 'actions' layer
- In the Menu bar, go to File > Open - open the flash-03.as
- Drag through (select) then copy (cmd/ctrl + c) the Thumbnail Video Gallery code
- Flip back to the ex-5.fla
- From the Menu Bar go to Window > Actions to open the Actions Panel
- Into the Blank Keyframe of the 'actions' layer, paste (cmd/ctrl + v) the code into the Actions Panel
- note the ActionScript symbol in the Blank Keyframe
- Save your file
- Test your movie
- Demo: adding the three videos from the previous exercise to the .xml file