3
CONTENTS
INTRODUCTION:Learning Macromedia Flash MX 2004 ...................9
Learning Flash overview .............................................9
Additional resources for learning Flash .................................10
CHAPTER 1:Create a Document ......................................13
Take a tour of the user interface.......................................14
Change background and Stage size ....................................16
Change your view of the Stage........................................16
View the Library panel .............................................17
Add graphics to the Stage ...........................................17
Add video .................................................. .....17
View object properties ..............................................18
Add video control behaviors .........................................18
Use the Movie Explorer to view the document structure ....................19
Test the document.......................................... .......19
Find help.............................................. ..........19
Summary........................................... .............20
CHAPTER 2:Create Accessible Flash Content ..........................21
Set up your workspace......................................... .....22
Specify that your document be accessible to screen readers ..................22
Provide a document title and description................................23
Provide a title and description for instances ..............................23
Specify that screen readers ignore elements in your document ................23
Change static text to dynamic text for accessibility ........................24
Control the tab order and reading order ................................24
About testing your document with screen readers .........................26
Summary........................................... .............26
CHAPTER 3:Write Scripts with ActionScript ............................27
Set up your workspace......................................... .....28
Create an instance of a symbol .......................................28
Name button instances .............................................29
Initialize the document .............................................30
About ActionScript syntax...........................................3 0
4 Contents
Locate ActionScript reference documentation ............................31
Add comments to ActionScript .......................................31
Write a function for a button.........................................31
Copy and modify a button function ...................................32
Check syntax and test your application .................................33
Summary........................................... .............33
CHAPTER 4:Create an Application ...................................35
Set up your workspace ..............................................36
Copy input and dynamic text fields....................................36
Name text fields .................................................. 37
Add and name a Button component ...................................37
Declare variables and values for the prices ...............................38
Specify values for input text fields .....................................38
Write a function .................................................. 39
Write an event handler for the component ..............................39
Test your application ...............................................40
Summary........................................... .............40
CHAPTER 5:Work with Layers .......................................41
Set up your workspace ..............................................42
Select a layer .................................................. ...43
Hide and show layers............................................ ...43
Lock a layer .................................................. ....43
Add and name a layer ..............................................44
Change the order of layers ...........................................44
Organize layers in a folder ...........................................44
Add a mask layer .................................................. 45
Add a guide layer............................................. .....45
Delete a layer............................................. ........46
Summary........................................... .............46
CHAPTER 6:Create a User Interface with Layout Tools ...................47
Set up your workspace ..............................................48
Use guides to align an object .........................................48
Change the Stage size ..............................................49
Resize objects to match the Stage size ..................................49
Specify snap alignment settings .......................................50
Align an object using the alignment guides ..............................50
Align objects using the Align panel ....................................51
Snap objects to each other ...........................................51
Align objects using the Property inspector ...............................52
Align objects using the grid and arrow keys ..............................52
Summary........................................... .............53
Contents 5
CHAPTER 7:Draw in Flash ..........................................55
Set up your workspace......................................... .....56
Select a shape tool .................................................5 6
Select options to create a polygon .....................................57
Draw a polygon........................................... ........57
Rotate the shape .................................................. 57
Use the cut-out feature .............................................58
Transform the shape of your drawing ..................................58
Copy strokes .................................................. ...59
Draw with the Line tool ............................................59
Select and add a different fill color.....................................59
Group the shape .................................................. 59
Create a logo with the Pen tool .......................................60
Summary........................................... .............61
CHAPTER 8:Create Symbols and Instances ............................63
Set up your workspace......................................... .....64
About creating symbols .............................................64
Create a graphic symbol ............................................65
Duplicate and modify an instance of a symbol ...........................66
Modify a symbol .................................................. 66
Create a movie clip symbol ..........................................67
Assign an instance name to the movie clip...............................67
Add an effect to the movie clip .......................................68
Summary........................................... .............68
CHAPTER 9:Add Animation and Navigation to Buttons ...................69
Set up your workspace......................................... .....70
Create a button from grouped objects ..................................70
Name a button instance.......................................... ...71
View the hit area by enabling buttons ..................................71
Change the hit area of a button .......................................71
Align buttons .................................................. ..72
Create animation for a button state ....................................73
Add an action to a button ...........................................73
Add navigation to a button ..........................................74
Test the SWF file.............................................. ....74
Summary........................................... .............75
CHAPTER 10:Add Static, Input, and Dynamic Text .......................77
Set up your workspace......................................... .....78
Create an expanding-width text block ..................................79
Create a fixed-width text block .......................................80
Edit text and change font attributes....................................80
Select device fonts .................................................8 0
Add an input text field .............................................81
Copy a text field .................................................. 81
6 Contents
Assign instance names to text fields ....................................82
Create a dynamic text field ..........................................82
Specify format options........................................... ...83
View ActionScript for the dynamic text field .............................83
Test the SWF file .................................................. 83
Check spelling .................................................. ..84
Summary........................................... .............84
CHAPTER 11:Create a Timeline Animation ..............................85
Set up your workspace ..............................................86
Create a motion tween .............................................86
Create a shape tween ...............................................87
Copy and paste keyframes in an animation ..............................88
Change the speed of the animation ....................................89
Test the SWF file .................................................. 89
Summary........................................... .............90
CHAPTER 12:Create a Presentation with Screens (Flash Professional Only) ...91
Set up your workspace ..............................................92
View the screen hierarchy and screen Timelines...........................93
View screen properties ..............................................93
Add content to a presentation slide ....................................94
Add screen navigation behaviors to buttons ..............................94
Add and name a slide ..............................................95
Select and move slides ..............................................95
Add content to a new slide ..........................................95
Add transition behaviors ............................................96
Test your presentation ..............................................96
Summary........................................... .............97
CHAPTER 13:Add Interactivity with ActionScript ........................99
Set up your workspace .............................................100
Name button instances ............................................100
Add a scene .................................................. ...101
Move between scenes............................................ ..101
Control the document with a stop()action .............................101
Link a button to a scene ...........................................102
Add navigation to return to Scene 1 ..................................102
Play a movie clip .................................................1 02
Use a behavior to play an mp3 file....................................104
Test your document.......................................... .....105
Summary........................................... ............105
Contents 7
CHAPTER 14:Create a Form with Conditional Logic and Send Data ........107
Set up your workspace......................................... ....108
Add an input text field to collect form data .............................108
Add a Submit button to the form ....................................109
Add an error message........................................... ...109
Add a confirmation message ........................................110
Add a stop()action ...............................................110
Add frame labels for navigation ......................................111
Add conditional logic for the Submit button ............................111
Pass data out of a SWF file .........................................112
Write a function for the Try Again button ..............................112
Test your SWF file.............................................. ..113
Summary........................................... ............113
CHAPTER 15:Work with Objects and Classes Using ActionScript 2.0 .......115
Set up your workspace......................................... ....116
About classes and object types .......................................116
Creating an object from a class ......................................116
Creating a custom class ............................................118
Create two objects from the Product class ..............................121
About extending existing classes .....................................122
Extend the MovieClip class to create a new class .........................122
Summary........................................... ............123