- Flash Guide 2006
- Welcome to the New Flash Reference Guide
- Flash Design Guide
- Introduction To Flash
- Working with the Authoring Tool
- Working with Templates
- FreeHand for the Power User
- Creating Animation with Fireworks
- Creating Animation in Flash
- Animating Text
- Working With Layers and Keyframes
- Working With Tweens
- Quickly Add Keyframes to Tweens
- Using Animation Paths
- Using Flash's Onion Skinning Tools
- Publishing Your Animation
- Preloading for Non-Programmers
- Drawing in Flash
- Using the Library
- Organizing Animations With Storyboards
- Working With Masks
- Making 2D Look 3D
- Working With Text
- Working With Input Text Fields
- Working With Dynamic Text
- Working with Text: Advanced Text Treatment With CSS
- Working With Text: Embedding Fonts
- Flash Interactive Developer Guide
- What is an Interactive Developer?
- Creating Flash Projects
- Using Form Applications
- Working with Form Components
- Setting up a Movie for Design and Animation
- Setting up a Movie for Programming
- Working with Components
- ActionScript Fundamentals
- Intro to Working With Arrays
- Understanding The Three Types of Arrays
- Control Data Stored in Arrays
- The Eolas Solution
- Intro to Flash Player 9
- Working with Strings
- Creating ActionScript Transitions
- Working with Boolean Objects in ActionScript
- Optimizing Delivery
- Working with Numbers in ActionScript
- Working with the Number Class
- Flash Professional 9 Preview
- Adobe Takes ActionScript Open Source
- Flash Rich Media Guide
- Pros and Cons of Flash 8 Video
- Using SMIL in Flash Video 8
- Stream an MP3 Audio File to Your Flash Movie
- Flash 8
- Introduction to Flash 8
- Advanced Text Rendering
- Using BitmapData Class in Your ActionScript
- The CacheAsBitmap Property
- Bitmap Rendering Improvements and Blend Modes
- Using The ExternalInterface Class
- Using Filters
- Downloading and Uploading Files with ActionScript
- Runtime Support for GIF and PNG Files
- Garbage Collection in Flash 8
- Using Enhanced Gradients
- Using Scale 9
- Stroke Enhancements in Flash 8
- Video Support in Flash 8
- How to Create a Slideshow
- Creating Dynamic Text in Flash
- Flash 3-D–Taking Flash to the Third Dimension!
- Object Collision Detection with Flash
- Create a Quiz With The Flash Quiz Template
- Working with Flash
- Uses for Flash
- Beyond Flash
- Flash Reference Guide
- Informit Articles and Sample Chapters
- Books
- Online Resources
- Blogs and Discussion
- Tools and Downloads
- Summary
- Flash MX Interface
- Welcome to Flash: the Designers' and Developers' Tool
- Using the Stage
- Panels, Panels Everywhere
- Using the Tools Pane
- Using the Property Inspector
- Using the Timeline Panel
- Using the Library
- Adding Interaction through the Actions Panel
- Integrating with Studio MX
- Saving and Publishing Flash Movies
- Informit Articles and Sample Chapters
- Books
- Online Resources
- Summary
- Drawing in Flash
- Shape Tools
- Applying Color
- Informit Articles and Sample Chapters
- Tools and Downloads
- Summary
- Flash Bitmaps
- Importing Bitmaps
- Exporting Bitmap Images
- Converting Bitmap Images to Vector Illustrations
- Informit Articles and Sample Chapters
- Online Resources
- Tools and Downloads
- Summary
- Flash Text and Text Fields
- Text Types
- Input Text
- Online Resources
- Tools and Downloads
- Summary
- Using the Library
- Library Organization
- Creating Instances
- Informit Articles and Sample Chapters
- Books
- Online Resources
- Summary
- Flash Animation
- Controlling Time
- Keyframe Animation
- Tweening
- Text Animation with Flash
- Informit Articles and Sample Chapters
- Books
- Online Resources
- Summary
- Flash Audio
- Using Audio in Flash
- Importing
- Linking to MP3
- Publishing Audio
- Streaming MP3 from the Flash Communication Server
- Informit Articles and Sample Chapters
- Online Resources
- Summary
- Video in Flash
- Video
- Flash Video
- Spark Codec
- Exporting Video
- Informit Articles and Sample Chapters
- Blog and Discussion
- Summary
- Flash Components
- Attaching Components to Movies
- Creating a Component
- Informit Articles and Sample Chapters
- Tools and Downloads
- Summary
- Exporting and Optimization
- Connecting Flash to the Internet
- Loading SWF Movies
- Sharing Fonts Between Movies
- Reusing Your ActionScripts
- Using Third-Party Tools
- Informit Articles and Sample Chapters
- Online Resources
- Tools and Downloads
- Summary
- Introduction to Design in Flash
- Introduction to Design
- Fundamental Design Concepts
- Breaking Up the Screen
- Branding
- Adding Forms to Movies
- Developing with ActionScript
- Introduction to Programming within Flash MX 2004
- Using ActionScript to Extend the Functionality of Flash
- ActionScript Fundamentals
- Using the Actions Panel
- Using the Reference Panel
- Rapidly Adding ActionScript with the Behaviors Panel
- Event Handling within ActionScript
- Timeline Events
- Triggering Events through User Interaction
- Flash MX 2004 Pro
- Summary
- Creating Interactive Movies
- Giving Users a Choice
- What it All Comes Down to
- Summary
- Testing your Flash Movies
- Naming Conventions
- Syntax Checker
- Testing your movies
- Summary
- Debugging
- Using the "Debugger"
- Reviewing ActionScript Error Codes
- Summary
- Using ActionScript to Control Your Movies
- Setting Up Your Movies for Interaction
- Making Movie Clips Behave Like Buttons
- Controlling Multiple Movie Clips
- Applying Different Types of Events to a Movie Clip
- Summary
- Using ActionScript to Control Text
- How ActionScript Can Control Text
- Using Cascading Style Sheets within Flash MX 2004 Dynamic Text Boxes
- Applying CSS formatting with ActionScript
- Where Do You Go Now?
- The Differences Between ActionScript 1 and ActionScript 2
- Working with Classes
- Which Version of the Flash Player should you use?
- What’s Next?
- Using Pre-Built Classes In Flash MX 2004
- Using a Class in ActionScript
- The List of Core Classes
- Flash Player-Specific Classes
- Summary
- Creating Your Own Classes
- Creating a Custom Class
- Working with External Data in Flash
- Why Use XML in Flash?
- Integrating Flash and XML
- Visual Elements
- Adding the ActionScript
- Future Shock
- Using Components
- Begin Using Components
- Building an Application with Components
- Gluing Components Together with ActionScript
- Summary
- Informit Articles and Sample Chapters
- Books and e-Books
- Online Resources
- Rich Internet Applications
- Introduction to Rich Internet Applications
- Why Use Flash for Building Application Solutions?
- Building Applications with Flash
- Getting Started
- Using Flash Variables
- Working with Parameters in the Object and Embed HTML Tags
- Linking data with Flashvars
- Getting Data Into Flash: Loading External SWF and JPG Files
- Why You Should Separate Your Files
- Loading Movies into Levels and Target Movie Clips
- Summary
- Loading SWF and JPG Images
- Working With XML: What is XML, and How Does it Relate to Flash?
- A Brief History of XML
- Why Structuring Your Data is Always a Good Thing
- How XML Came to Flash
- Summary
- Working with XML: Good XML vs. Bad XML
- Good Places to Start
- Writing Good XML
- XML Tools
- The Next Step - Using XML in your Flash Applications
- Working with XML: Loading XML into Flash
- Integrating Flash and XML
- Visual Elements
- ActionScript
- Future Shock
- Working with XML — Dynamically Building XML with .NET, ColdFusion, Java, and PHP
- ColdFusion
- .NET
- Java
- PHP
- Summary
- Working with XML — Web Services
- SOAP Support in Flash MX 2004
- Using Components to Bind Web Services into your Applications
- Summary
- Working with Data — Working with XML
- XML In Flash
- Writing XML In Flash
- Building Trees of Data with XML
- Working with Data: Pushing Data back to the Server with Load Vars
- Setting up the Database
- Writing the VB.NET Code
- Creating the Flash Movie
- Working with Data: Leveraging Persistent Connections
- Using XMLSocket Connections
- XMLSocket Server
- XMLSocket Security
- XMLSocket Class in Flash
- Creating a Pong Game with an XMLSocket Server
- Summary
- Flash Remoting
- What is Flash Remoting?
- Using Flash Remoting
- The Future of Flash Remoting
- Flash Remoting Links
- Working with Data: Macromedia Flex Presentation Server
- What Problem Does Flex Presentation Server Address?
- How does Flex work?
- Coding and Building Flex Applications
- Building Rich Internet Applications: Connecting Flash to a Database
- Using FlashVars
- Using LoadVars
- Loading XML
- Consuming a Web Service
- Live data connections with XMLSocket Connections
- Building Rich Internet Applications: Planning, Planning, Planning
- A Simple Plan
- Tools You Can Use
- Applying a Discipline
- Building Rich Internet Applications: Design Counts
- Do Not Be Afraid to Ask For Help
- What if You Do Not Have a Ben To Call
- Building Rich Internet Applications: Beyond the Movie Clip
- UI Components
- Data Components
- Media Components
- Manager Components
- Screen Components
- Building Rich Internet Applications: Using Macromedia Central
- What Central is All About
- Who is Using Central?
- Developing for Macromedia Central
- Next Steps You Need to Take
- Building Rich Internet Applications: Using Macromedia Flex
- Authoring with Flex
- Publishing with Flex
- Presenting the Solution: Delivering Flash Applications to the Web
- Flash's own Publishing Tools
- Using Dreamweaver
- Writing your Own HTML
- Presenting the Solution: Delivering Flash Over Non-PC Devices
- Using Macromedia's Flash Lite
- Programming for Flash Lite
- FlashCast
- Informit Articles and Sample Chapters
- Books and e-Books
- Flash for Designers: Rich Media Production
- Graphic Control in Flash
- Drawing in Flash
- Importing Vector Art
- Importing Raster
- Scripting Images
- Introduction to the Rich Media Production
- Using Video, Audio and Images in your Flash Movies
- Using SWF Flash Movies
- Using JPEG Images
- MP3 Sound Files
- Flash Video
- Using Components to Build Rich Media Solutions
- Using the Loader Component
- Using the Media Components
- Controlling Components with ActionScript
- Controlling the Loader Component
- Media Components
- Using Audio in Flash
- Linking to MP3
- ActionScript-Controlled Audio
- Volume Control
- Publishing Audio
- Summary
- Video in Flash
- Working with Video
- Controlling Video with Components
- Exporting Video
- Summary
- Choosing Which Version of Flash Communication Server to Use
- Server Requirements
- Installation
- Running Communication Server on Different OS Platforms
- Pitfalls to Watch for
- Summary
- Streaming Video
- Live Video
- Broadcast Video on Demand
- Flash Video Components
- The Communication Server MX Server Code for the VideoPlayBack Component
- Record Video with VideoRecord Communication Component
- Create A Video Conference
- Examining the VideoConferencing Component
- The Communication Server MX Server Code for the VideoConferencing Component
- Summary
- Using the Microphone and Camera Core Classes
- Microphone
- Camera
- Constructing Large Applications That Leverage Video and Audio
- Configuring the Server
- Creating the Movie
- Broadcasting
- Summary
- Informit Articles and Sample Chapters
- Books and e-Books
- Matthew's Predictions for 2006
- Matthew's Favorite Flash Books
- Matthew's Favorite Flash Web Resources
- Macromedia as Part of Adobe
- First Look: Flash Player 8
- First, the Facts
- What Macromedia Brings to the Table
- What Adobe Brings to the Table
- What the Two Companies Can Do for Each Other
- A Brief History of Flash
Behind all the glitter of Flash is a powerful programming language called ActionScript. ActionScript is the tool that allows you to add interaction to Flash. Whether that interaction is a tool that stops a movie from playing or that calculates your score in a game, it is always ActionScript that causes this interaction.
ActionScript is based very solidly on JavaScript. Both languages find their roots in the industry standard Document Object Model, or DOM. Generally, industry standards are more widely used, which means that if you know JavaScript, you'll be able to pick up ActionScript very quickly.
At some point you will want to do something in Flash that requires the user to interact with the program. This may be something as simple as creating a navigation bar or as complicated as creating a game. Whatever your needs, you will have to use ActionScript to do it.
Where to place ActionScript in Flash Authoring Tool
All of the scripts you write for Flash will be placed within the Actions Panel. When you are working directly in Flash there are two places where you can add scripts: Object and Frame.
ActionScript can be added to a movie clip, button or object on the Stage. Scripts can also be placed in the Timeline in a specific frame. There are advantages to both.
When you edit your Flash document and use the Actions panel to create scripts, keeping track of what object or frame is currently selected is important. Sometimes the action of opening the Actions panel causes Flash to deselect the object to which you wanted to assign a script, so Flash starts applying the code to the currently selected frame instead. As a quick check, always take note of whether the Actions panel is labeled Frame Actions or Object Actions; that gives you a guide as to what you're actually editing. Look at the top of the panel to see which type you're working with.
There are two ways you can work with the Actions Panel: Script Assist and Normal. You can find these two options in the properties for the Actions panel.
Open the Actions panel and select the top right-hand corner of the panel. You see the dropdown menu where you can choose between Normal and Expert modes.
The Script Assist mode makes it easier for users who are new to programming or who do not know how to program to begin working with ActionScript. Helpers and guides in the Script Assist mode complete much of the programming for you. You can still do most of the tricks developed in this guide, but you won't be able to complete all of them.
The Normal mode is freestyle time! There are no training wheels here. Basically, the Actions panel becomes nothing more than a text editor, which does make scripting harder because the guides are gone; however, as you become more adept at programming in ActionScript, you will find this mode much easier to work in. You also receive the benefit of new tools such as code hinting.
A very useful tool in the Expert mode is the Check Syntax tool. When you're in Expert mode you can see its icon, the blue check mark, on the top of the Actions panel.
The role of this very useful tool is to read your ActionScript and check for any errors. If everything is correct then an alert box pops up and declares "The script contains no errors". If the tool finds any errors the alert box reads "The script contains errors." Fortunately, it doesn't leave you hanging at this point. The Output panel opens automatically and lists all the syntactical errors it finds on the page. The Output window tells you to the line number where to find your error and then explains what the error is and a possible fix.
Now, I don't want you to think that the Check Syntax tool fixes your ActionScript. The solutions that it presents to you as ways of fixing your script are very generic. What it does, however, is alert you to where you're having problems and prepares you to begin debugging.
The Reference panel is a second tool that you should take advantage of. The tool helps to explain what specific ActionScript terms do and how to use them.
In the Actions panel enter the following:
loadMovieNum ("test.swf", 1);
This ActionScript loads an external SWF movie called test.swf into level 1 of the main Flash movie. If you want to find out what this specific action accomplishes, select the word loadMovieNum and select the question mark in the Actions panel, which forces the Reference panel to open to a specific reference of loadMovieNum. Each reference is broken down with a description, which version of Flash supports the action, examples on how to use the action, and links to other related actions.
A third tool on the Actions panel that helps you with your programming is the Show Code Hint tool. The function of the Show Code Hint button is to demonstrate how to write a specific line of code. You can think of the Show Code Hint as that really friendly tool that knows everything.
Here is how it works. Suppose you have the following ActionScript on the page:
on (release) { mouse.hide(1); }
For the script to work you want the event to be initialize as you click you mouse on the button. But, how the heck do you do that? What you do is delete the word release in the parentheses. This is the event word you want to replace. Now, click the Show Code Hint button. What you get is a drop-down menu inline with your ActionScript. Now you have a list of events you can use.
Another useful tool Normal mode gives you is the Auto Format tool. This tool, displayed in the toolbar at the top of the Actions panel, helps you format your code. As you write code you may find that you end up with concatenated it/else statements, or other script that appears to run together. This code can often be very hard to read, particularly if a lot of spaces are placed between different sections of code. The Auto Format tool reshuffles your ActionScript, eliminating spaces and indenting nested scripts, to make the code easier to read. This reshuffling saves your addled senses.
External ActionScript - #Include Object
As an ActionScript programmer you are going to start with small scripts and then they will grow. This is because you will feel more confident with your programming skills.
When you have an identical ActionScript required for two or more programs you can re-use the ActionScript through the #include object.
The #include object allows you to point Flash to an external text file containing ActionScript. The file is dynamically loaded into Flash when a movie is run. The power with this tool is that you can re-use the same scripts in a limitless number of movie.
The include object is relatively simple to use. However, its power in re-use is undeniable.
Knowing When to Use Which Version of ActionScript
ActionScript is an evolving language. Currently there are three main releases of ActionScript plus a mobile version of ActionScript for Flash Lite. The trick is often knowing which version to use where and when. The main guideline really is driven by your customers' needs. Will they allow you to use the latest and greatest features in Flash, or do they want to play it safe and have you build solutions for them in Flash 7 or 6? If you are building solutions for Flash Player 5 and 6 then you are limited to ActionScript 1. ActionScript 1 has limited Object Oriented development and streamlining. If you can build solutions for Flash Player 7 and 8 then you can take advantage of ActionScript 2.0 and full and complete OO language. If you are targeting Flash Player 8.5 and later then take advantage of ActionScript 3.0.
ActionScript is a lot of fun. Flash really comes to life as you add interaction through ActionScript to your movies.