ActionScripting in Flash
Phillip Kerman(Author)
Sams Publishing
Published on 23. April 2001
Book
Paperback/Softback
648 pages
978-0-672-32078-1 (ISBN)
Description
The book is structured into three parts: Foundation knowledge (general programming theory applied to Flash with short tasks to demonstrate specific concepts), Applied workshop (more involved tasks broken into three parts each--design discussion, the building steps, and analysis with suggestions of variation), and Appendices (which provides a concise listing of some of the more useful elements in ActionScript).
The book will begin with foundation knowledge and will build on that with practical workshops. This way, the readers should be able to apply what they learn to future challenges they might encounter.
The book will begin with foundation knowledge and will build on that with practical workshops. This way, the readers should be able to apply what they learn to future challenges they might encounter.
More details
Language
English
Place of publication
Indianapolis
United States
Publishing group
Pearson Education (US)
Target group
College/higher education
Dimensions
Height: 231 mm
Width: 187 mm
Thickness: 30 mm
Weight
1056 gr
ISBN-13
978-0-672-32078-1 (9780672320781)
Copyright in bibliographic data is held by Nielsen Book Services Limited or its licensors: all rights reserved.
Schweitzer Classification
Person
Phillip Kerman is an independent programmer, teacher, and writer specializing in Macromedia products. His degree in Imaging and Photographic Technology from the Rochester Institute of Technology was earned back when "multimedia" had a different meaning than today. One of Phillip's internships, for example, involved programming multiple slide projector presentations with dissolves synchronized to a sound track?the multimedia of the 1980s. In 1993, he found Macromedia Authorware a natural fit for his interest and skills. After getting his start at The Human Element, Inc., he moved back to Portland, Oregon to work on his own.
Phillip has transitioned his expertise from Authorware to Director, and now, to Flash. Over seven years, he has had to adapt to a total of 13 version upgrades?Flash 5 being the most significant of them all! In addition to retooling and building his own skills, Phillip finds teaching the biggest challenge. He has trained and made presentations around the world, in such exotic locations as Reykjavik, Iceland; Melbourne, Australia; Amsterdam, Holland; and McAlester, Oklahoma. He wrote Sams Teach Yourself Macromedia Flash 5 in 24 Hours (that is the title, not how long it took to write). His writing has also appeared in such publications as Macworld, Macromedia User Journal, and his self-published The Phillip Newsletter (http://www.teleport.com/~phillip/newsletter/).
In addition to showing others how to create multimedia, Phillip has had plenty of opportunities to get his hands dirty in programming. Last century, Phillip programmed the all-Flash Web site http://www.m-three.com for Paris France Inc. This site was included in both Communication Arts Interactive Design Annual and the British Design & Art Direction Annual in 2000. The latest version of the M3 site won the navigation category at the London Flash Film Festival. Feel free to email Phillip at flash5@onemain.com.
Phillip has transitioned his expertise from Authorware to Director, and now, to Flash. Over seven years, he has had to adapt to a total of 13 version upgrades?Flash 5 being the most significant of them all! In addition to retooling and building his own skills, Phillip finds teaching the biggest challenge. He has trained and made presentations around the world, in such exotic locations as Reykjavik, Iceland; Melbourne, Australia; Amsterdam, Holland; and McAlester, Oklahoma. He wrote Sams Teach Yourself Macromedia Flash 5 in 24 Hours (that is the title, not how long it took to write). His writing has also appeared in such publications as Macworld, Macromedia User Journal, and his self-published The Phillip Newsletter (http://www.teleport.com/~phillip/newsletter/).
In addition to showing others how to create multimedia, Phillip has had plenty of opportunities to get his hands dirty in programming. Last century, Phillip programmed the all-Flash Web site http://www.m-three.com for Paris France Inc. This site was included in both Communication Arts Interactive Design Annual and the British Design & Art Direction Annual in 2000. The latest version of the M3 site won the navigation category at the London Flash Film Festival. Feel free to email Phillip at flash5@onemain.com.
Content
I. Foundation.
Introduction.
1. Flash Basics.
Timeline Hierarchy.
Implications for Animation and Filesize.
Implications for Programming.
Targeting.
Script Locations.
Always Movie Clips.
Coordinate System.
Tricks of the Trade.
Invisible Buttons.
Empty Movie Clips.
Empty Layers and Keyframes.
Summary.
2. What's New in Flash.
Advanced Features Making Programming Easy.
Clip Events.
Smart Clips.
External Scripts.
Custom Functions.
Objects.
HTML Text.
Previous Knowledge Worth Forgetting.
Deprecated ActionScript.
Non-Deprecated ActionScripts That Should Be.
Old Tricks That Are Old News.
Summary.
3. The Programmer's Approach.
Specification.
Prototyping.
Hard Wiring.
Pseudo-Code.
Good Style.
Less Is More.
Comments.
Magic Numbers, Constants, and Variables.
Repeated Code.
Code Data Separation.
Summary.
4. Basic Programming in Flash.
Terminology, Special Characters, and Formatting.
Events.
Results of Events.
Terms.
Special Characters and Formatting.
Data Types and Variables.
Variables' Names and Values.
String and Number Data Types.
Other Data Types.
Using Variables.
Assigning and Accessing Variables.
Comparing and Passing Values.
Scope and Variable Collision.
Dot Syntax.
Summary.
5. Programming Structures.
Statements, Expressions, and Operators.
Writing Expressions.
Using Operators in Expressions.
Types of Statements.
Built-in Statements.
Simple Objects in Statements.
Using the Math Object.
Using the Number Object.
Conditional and Loop Statements.
Conditional Statements: if, if else, if else if.
Loop Statements: for, for in.
while.
Applied Expression Writing.
Summary.
6. Debugging.
General Approaches to a Bug-Free Life.
Finding and Defining Bugs.
Fixing Bugs.
Preventing Bugs.
Using the Debugger.
Viewing and Setting Properties and Variables.
Watching Variables.
Remote Debugging.
Strategies of Debugging.
Summary.
7. The Movie Clip Object.
Properties of Clips.
You Can Get Them All, But You Can't Set Them All.
Anonymous Targeting.
Variables in Clips (or "Homemade Properties").
Methods of Clips.
Referencing Clips and Targeting.
Relative and Absolute Referencing.
Dynamic Referencing.
Summary.
8. Functions.
How to Use Functions.
Using Built-in Functions.
Using Homemade Functions.
Creating Homemade Functions.
Basics.
Functions as Subroutines.
Making Functions That Accept Parameters.
Making Functions That Return Values.
Using Functions as Methods.
Local Variables.
Applying Functions to Previous Knowledge.
Review Built-in Functions.
Things to Remember.
Summary.
9. Selecting Text, Trapping Keys, and Manipulating Strings.
String Object Form.
Esoteric String Object Details.
Methods of the String Object Explored.
Zero-Based System.
Extracting Portions of Strings.
Extracting Characters, Changing Case, and Searching.
String Object Methods Applied.
Using HTML Text.
Selection Object.
Getting and Setting Focus.
Setting and Getting Selections.
Key Object.
Using the Key Object.
Key Object Examples.
Summary.
10. Arrays.
Array Overview.
Array Creation and Manipulation.
Creating and Populating Arrays.
Accessing Array Contents.
Array Object Methods.
Associative Arrays.
Summary.
11. Objects.
Formal Rules of Objects.
Attach Sound.
Sound Object Basics.
Advanced Sound Controls.
Controlling Multiple Sounds.
Color.
Simple Coloring.
Using RGB Values.
Using the Color Transform Method.
Date.
Instantiating a Date.
Manipulating Dates.
Attach Movie Clip.
Summary.
12. Homemade Objects.
Basic Objects.
Using Constructor Function.
Making Methods.
Inheritance.
Practical Example of Homemade Objects.
Summary.
13. Smart Clips.
Standard Smart Clips.
Making Smart Clips.
Advanced Applications for Standard Smart Clips.
Replacing the Clip Parameters Panel with Custom UIs.
Designing Custom UIs.
Building Custom UIs.
Summary.
14. Interfacing with External Data.
External Scripts.
External Data Files.
Waiting for Variables to Load.
Data File Format.
Examples of Using External Data Files.
Server Scripts.
XML.
JavaScript
Quick and Dirty Method.
JavaScript Talking to Flash.
Targeting the Flash Object.
Workarounds.
Director and Authorware.
Flash in Authorware.
Flash in Director.
Summary.
II. Workshop.
Introduction.
IIA. Beginning Workshops.
1. Ensuring That Users Have the Flash 5 Player.
2. Faking Video.
3. Creating Custom Cursors.
4. Creating a Horizontal Slider.
Creating a Quick and Dirty Slider.
Converting the Slider into a Smart Clip.
Summary.
5. Building a Slide Show.
6. Mapping.
7. Working with Odd-Shaped Clickable Areas.
8. Adapting Built-in Smart Clips.
IIB. Intermediate Workshops.
9. Creating a Currency-Exchange Calculator.
10.Creating a ToolTip Smart Clip.
11.Creating a Digital Timer.
12.Creating an Analog Timer.
13.Creating a Countdown Timer.
14.Using Math to Create a Circular Slider.
15.Developing Time-Based Animations.
16.Creating a Multistate Button.
IIC. Advanced Workshops.
17. Offline Production.
18. Creating a Dynamic Slide Presentation.
19. Creating JavaScript Cookies.
20. Writing JavaScript Inter-Movie Communications.
21. Fixing Broken Scripts.
Card Flip.
Hint.
Solution.
Card Snap.
Hint.
Solution.
Circle Move.
Hint.
Solution.
Multiple Choice.
Hint.
Solution.
Rotating Box.
Hint.
Solution.
Word Float.
Hint.
Solution.
Yellow Box.
Hint.
Solution.
Click and Hold.
Hint.
Solution.
Objects.
Hint.
Solution.
Move Multiple.
Hint.
Solution.
Summary.
III. Appendices.
Appendix A. Equivalents.
Alternatives to Deprecated Code.
tellTarget().
call().
ifFrameLoaded().
toggleHighQuality().
eval().
Logical Operators (and, or, and not).
String Comparison Operators (eq, ge, gt, le, lt, and ne).
String Functions.
int().
random().
No More Funkiness.
Two-Frame "Updater" Movie Clips.
Drag Invisible Movie Clip to Ascertain Mouse Position.
Pseudo Arrays.
URL-Encoded Data Instead of XML-Structured.
The Oldest Ones in the Book.
You Can't Set _currentframe.
You Can Jump Only to Integer Frame Numbers.
There's a Big Difference Between = and ==.
For-Loops Use Semicolons, Not Commas.
Appendix B. Making Flash Extensions for the Macromedia Exchange Web Site.
How It Works.
The MXI File Format.
Index.
Introduction.
1. Flash Basics.
Timeline Hierarchy.
Implications for Animation and Filesize.
Implications for Programming.
Targeting.
Script Locations.
Always Movie Clips.
Coordinate System.
Tricks of the Trade.
Invisible Buttons.
Empty Movie Clips.
Empty Layers and Keyframes.
Summary.
2. What's New in Flash.
Advanced Features Making Programming Easy.
Clip Events.
Smart Clips.
External Scripts.
Custom Functions.
Objects.
HTML Text.
Previous Knowledge Worth Forgetting.
Deprecated ActionScript.
Non-Deprecated ActionScripts That Should Be.
Old Tricks That Are Old News.
Summary.
3. The Programmer's Approach.
Specification.
Prototyping.
Hard Wiring.
Pseudo-Code.
Good Style.
Less Is More.
Comments.
Magic Numbers, Constants, and Variables.
Repeated Code.
Code Data Separation.
Summary.
4. Basic Programming in Flash.
Terminology, Special Characters, and Formatting.
Events.
Results of Events.
Terms.
Special Characters and Formatting.
Data Types and Variables.
Variables' Names and Values.
String and Number Data Types.
Other Data Types.
Using Variables.
Assigning and Accessing Variables.
Comparing and Passing Values.
Scope and Variable Collision.
Dot Syntax.
Summary.
5. Programming Structures.
Statements, Expressions, and Operators.
Writing Expressions.
Using Operators in Expressions.
Types of Statements.
Built-in Statements.
Simple Objects in Statements.
Using the Math Object.
Using the Number Object.
Conditional and Loop Statements.
Conditional Statements: if, if else, if else if.
Loop Statements: for, for in.
while.
Applied Expression Writing.
Summary.
6. Debugging.
General Approaches to a Bug-Free Life.
Finding and Defining Bugs.
Fixing Bugs.
Preventing Bugs.
Using the Debugger.
Viewing and Setting Properties and Variables.
Watching Variables.
Remote Debugging.
Strategies of Debugging.
Summary.
7. The Movie Clip Object.
Properties of Clips.
You Can Get Them All, But You Can't Set Them All.
Anonymous Targeting.
Variables in Clips (or "Homemade Properties").
Methods of Clips.
Referencing Clips and Targeting.
Relative and Absolute Referencing.
Dynamic Referencing.
Summary.
8. Functions.
How to Use Functions.
Using Built-in Functions.
Using Homemade Functions.
Creating Homemade Functions.
Basics.
Functions as Subroutines.
Making Functions That Accept Parameters.
Making Functions That Return Values.
Using Functions as Methods.
Local Variables.
Applying Functions to Previous Knowledge.
Review Built-in Functions.
Things to Remember.
Summary.
9. Selecting Text, Trapping Keys, and Manipulating Strings.
String Object Form.
Esoteric String Object Details.
Methods of the String Object Explored.
Zero-Based System.
Extracting Portions of Strings.
Extracting Characters, Changing Case, and Searching.
String Object Methods Applied.
Using HTML Text.
Selection Object.
Getting and Setting Focus.
Setting and Getting Selections.
Key Object.
Using the Key Object.
Key Object Examples.
Summary.
10. Arrays.
Array Overview.
Array Creation and Manipulation.
Creating and Populating Arrays.
Accessing Array Contents.
Array Object Methods.
Associative Arrays.
Summary.
11. Objects.
Formal Rules of Objects.
Attach Sound.
Sound Object Basics.
Advanced Sound Controls.
Controlling Multiple Sounds.
Color.
Simple Coloring.
Using RGB Values.
Using the Color Transform Method.
Date.
Instantiating a Date.
Manipulating Dates.
Attach Movie Clip.
Summary.
12. Homemade Objects.
Basic Objects.
Using Constructor Function.
Making Methods.
Inheritance.
Practical Example of Homemade Objects.
Summary.
13. Smart Clips.
Standard Smart Clips.
Making Smart Clips.
Advanced Applications for Standard Smart Clips.
Replacing the Clip Parameters Panel with Custom UIs.
Designing Custom UIs.
Building Custom UIs.
Summary.
14. Interfacing with External Data.
External Scripts.
External Data Files.
Waiting for Variables to Load.
Data File Format.
Examples of Using External Data Files.
Server Scripts.
XML.
JavaScript
Quick and Dirty Method.
JavaScript Talking to Flash.
Targeting the Flash Object.
Workarounds.
Director and Authorware.
Flash in Authorware.
Flash in Director.
Summary.
II. Workshop.
Introduction.
IIA. Beginning Workshops.
1. Ensuring That Users Have the Flash 5 Player.
2. Faking Video.
3. Creating Custom Cursors.
4. Creating a Horizontal Slider.
Creating a Quick and Dirty Slider.
Converting the Slider into a Smart Clip.
Summary.
5. Building a Slide Show.
6. Mapping.
7. Working with Odd-Shaped Clickable Areas.
8. Adapting Built-in Smart Clips.
IIB. Intermediate Workshops.
9. Creating a Currency-Exchange Calculator.
10.Creating a ToolTip Smart Clip.
11.Creating a Digital Timer.
12.Creating an Analog Timer.
13.Creating a Countdown Timer.
14.Using Math to Create a Circular Slider.
15.Developing Time-Based Animations.
16.Creating a Multistate Button.
IIC. Advanced Workshops.
17. Offline Production.
18. Creating a Dynamic Slide Presentation.
19. Creating JavaScript Cookies.
20. Writing JavaScript Inter-Movie Communications.
21. Fixing Broken Scripts.
Card Flip.
Hint.
Solution.
Card Snap.
Hint.
Solution.
Circle Move.
Hint.
Solution.
Multiple Choice.
Hint.
Solution.
Rotating Box.
Hint.
Solution.
Word Float.
Hint.
Solution.
Yellow Box.
Hint.
Solution.
Click and Hold.
Hint.
Solution.
Objects.
Hint.
Solution.
Move Multiple.
Hint.
Solution.
Summary.
III. Appendices.
Appendix A. Equivalents.
Alternatives to Deprecated Code.
tellTarget().
call().
ifFrameLoaded().
toggleHighQuality().
eval().
Logical Operators (and, or, and not).
String Comparison Operators (eq, ge, gt, le, lt, and ne).
String Functions.
int().
random().
No More Funkiness.
Two-Frame "Updater" Movie Clips.
Drag Invisible Movie Clip to Ascertain Mouse Position.
Pseudo Arrays.
URL-Encoded Data Instead of XML-Structured.
The Oldest Ones in the Book.
You Can't Set _currentframe.
You Can Jump Only to Integer Frame Numbers.
There's a Big Difference Between = and ==.
For-Loops Use Semicolons, Not Commas.
Appendix B. Making Flash Extensions for the Macromedia Exchange Web Site.
How It Works.
The MXI File Format.
Index.