- 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
Most components are comprised of two distinct elements: graphics and ActionScript (which are kept separate from each other). In this section, you create the graphics needed for the Preloader component.
Create a new movie. Size the movie to 400 pixels x 200 pixels. The size of the movie is not critical to the final component; it merely gives you extra room in which to develop.
On the Stage, draw a rectangle 240 pixels x 10 pixels.
Select the rectangle, press F8, and convert the shape into a Movie Clip; name it bar_graphic.
Create a new Movie Clip in the Library and name it color.
Edit the color Movie Clip. In the center of it, create a blue rectangle 240 pixels x 40 pixels. You need to use the content of the bar_graphic Movie Clip in a second movie. Drag a second instance of the bar_graphic from the Library; select the new instance. In the Property Inspector, name the instance bar_clip. The Clip maintains all the visual elements of the bar_graphic Clip. Edit the Clip and fill its center with the color #6600CC.
Combine the Movie Clips for the final movie. In the Library, create a new Movie Clip and name it bar_clip. Edit the Movie Clip and give it two layers, labeled Alpha and Color. Drag the Color layer beneath the Alpha layer. Select the Color layer. Drag the instance of the color Movie Clip into the center of the Stage. Select the Alpha layer and drag an instance of bar_graphic Movie Clip over the color Movie Clip. With the bar_graphic still selected, select Alpha from the color drop-down menu in the Property Inspector. Change the Alpha level to 70%. The color Movie Clip should now be visible through the bar_graphic Movie Clip.
From the Library, create another Movie Clip and name it preload_clip. Edit the preload_clip. Drag an instance of bar_graphic onto the center of the Stage within the preload_clip movie instance. Name the bar_graphic Movie Clip bar in the Property Inspector.
These few steps are all you need to build all the graphical elements for the component. It is good to get in to the habit of organizing your Library with folders for different parts of your component, which makes it easier to manage the different elements of the component.
Managing Your Library
The elements that allow you to define a component are all contained within the Library. Where you place the folders and how you name the specific movies control the way a component is constructed.
Begin by organizing your Library. Create a new folder and name it Preloader Assets. Drag all the movies that you have created so far into the Preloader Assets folder.
Create a second folder and name it FCustomIcons. You will use this folder later in the section to create a custom icon for your component.
In the Library, create a new Movie Clip and name it Preloader. Do not place this Movie Clip in a folder; it becomes the component.
NOTE
An Assets folder is a standard used with many components. It is used for storing Movie Clips, buttons, and graphics.
NOTE
The name FCustomIcons has a special meaning with Flash MX. A bitmap file added to this folder with the same name as the component will become the default icon for the component.
Creating the Component
As a designer, you want to control how the text appears in the Preloader.
From the Library, select the Preloader Movie Clip and open it in Edit mode. Select Frame 1 of the movie. Add the following ActionScript (notice that it is the same Preloader script created earlier in this section):
Right-click the Preloader Movie Clip in the Library. Select Component Definition, and the Component Definition window opens. In the Parameters section, select the + symbol and add a new parameter.
Name the variable Font Face. This name appears in the Parameter name for this component. Next, link this name to a variable you created in your earlier ActionScript; in this case, the variable is txtfont (for variable, type txtfont). From the drop-down menu in the type field, choose Font Name. This option defaults the Value field to list Fonts. Choose _sans.
Add a second parameter and name it Font Color. Choose the variable to be txtcolor and the type field to be color. The value should be #000000 (this is the hex number for black). You need to add variables that reference Txtbold, Txtitalic, Txtsize, barcolor, and txtstyle. Each of these variables controls visual elements you see on the Stage.
Enter Preloader for ToolTip text and click OK.
The icon for the movie has now changed to show that the Movie Clip is now a component.
myformat = new textformat() myformat.font = txtfont; myformat.color = txtcolor; myformat.bold = txtbold; myformat.italic = txtitalic; myformat.size = txtsize; myformat.align = "center" preloader._visible=false; if (preloader.percentbytes >= 100){ _root.play(); } myColor = new Color(preloader.bar.barcolor);
myColor.setRGB(barcolor);
This code establishes variable names for a variable called myformat. Notice that myformat is the name of the text box programmatically created in your script. The value of creating a component is that you can manipulate parameters within the component; for example, font type, size, and color. Parameters can be set up in a component to allow you to have this level of control.
At this point, the component is done. Drag an instance of it onto the Stage and observe the parameters you can change in the Property Inspector. You can leave the component as is, but the next section shows you how to take it a few steps further to make the component very useful.
Creating a Custom Icon
When you set up the Library for the component, you added a folder called FCustomIcons. This folder is special in that it tells Flash to look for a match between a graphic file and the component. If the graphic and the name match, the component adopts the graphic image as the default image for the component. Follow these steps to create a custom icon of your own:
Create an icon. You can create icons with the PNG, GIF, or JPEG image formats. The image should be 23 pixels x 20 pixels to fit on the Components panel.
Import an image that will be used as the icon directly into the Library.
Move the image into the FCustomIcons folder. Rename the image to the same name as the componentthe names must be identical.
Close the Library.
Reopen the Library. The symbol for the component should now look like the graphic you imported.
The possibilities are limitless as to what you can use as the graphic for your component. Let your imagination go wild!
Placing the Component in the Components Panel
So now you have a component that works, and it has a cool icon. Now you need to be able to use the component each time you run Flash MX. To be able to do so, all you need to do is save the Preloader.fla file to a special place within the configuration folder for your computer.
Each computer's operating system keeps the components in a different place. Check Table 1 for your computer operating system type.
Table 2 Where to Save Components
Operating System |
Location |
Windows 2000 and XP |
C:\Documents and Settings\User\Application Data\Macromedia\Flash MX\Configuration\Components\ |
Windows 98 and ME |
C:\Windows\Application Data\Macromedia\Flash MX\Configuration\Components\ |
Windows NT |
C:\WinNT\Profiles\User\Application Data\Macromedia\Flash MX\Configuration\ |
MAC OS X |
Hard Drive:Users:Library:Application Support:Macromedia:FlashMX:Configuration:Components |
Mac OS 9.x (multi-user) |
Hard Drive:Users:User:Documents:Macromedia :FlashMX:Configuration:Components: |
After you place the file in the correct folder, close Flash MX. When you reopen Flash, go to the Component folder to find your new component. Whenever you open any new file, you have access to the component.
You now need to know how to package the component for distribution over the Internet. To package the component, you have to create a file that is controlled by the Macromedia Extension Manager, which is a cool tool that allows you to add any number of new extensions for any Macromedia product.
NOTE
The Extension Manager is installed as part of the Flash MX installation.
You can create the files needed to distribute the Preloader by first creating an MXI document called Preloader.mxi. This file contains the information that the Extension Manager needs to create a packaged file for distribution over the Internet. You can download this sample file from the web site.
The following tutorial explains how to package your components into a portable format using the Macromedia Extension Manager.
Copy the Preloader.fla file to a new folder.
Open Notepad or any text editor and create a file called Preloader.mxi. Save this file to the same folder that contains your component. This MXI file tells the Extension Manager where to place the Preloader.fla file.
Open the MXI folder and add the following XML script:
Save the file.
Open the Extension Manager.
Choose File, Package Extension. A window opens that allows you to select the MXI file you have created.
Navigate to the Preloader.mxi file. Click OK. You are asked where Preloader.mxp should be saved. Save it to your desktop.
The following code allows you to give the component some properties. The first is IDeach component you create must have a unique ID. The Extension Manager does not load the movie if you do not provide a unique ID.
The second and third lines allow you to give your Preloader a name and a version. You can create a component and keep modifying it over a period of time. Each time you modify a component and package it with the Extension Manager, give the component a version number, which enables you to track which version of the component you are distributing.
The type definition identifies what kind of component you are creating. The standard is to label them Flash Component.
The product name identifies which Macromedia product your extension is being created for. The Extension Manager manages all extensions for Flash MX, Dreamweaver MX, Fireworks MX, and UltraDev. Type in Flash for the name and add 6 as the version number. (This refers to Flash MX, which is the sixth major release of Flash.)
You can also add your own name, which shows up in the Extension Manager.
TIP
I always add my Web site address for just a bit of free advertising.
<macromedia-extension id="md05072002" name="Preloading Component" version="1.0" type="Flash Component" requires-restart = "false"> <!-- List the required/compatible products --> <products> <product name="Flash" version="6" primary="true" /> </products> <!-- Describe the author --> <author name="Matthew David - http://www.matthewdavid.ws" /> <!-- Describe the extension --> <description>
<![CDATA[
The following section of code from the MXI script describes where the Preloader component is installed. You want to install the component in the Components folder for Flash MX. You do not know which system Flash MX is installed or how a user has installed it. To solve this problem, the Extension Manager allows you to add a $ symbol before flash/Components.
NOTE
The dollar sign is a special character that tells the Extension Manager to look for the directory in which Flash is installed. This works for all computer systems supporting the Extension Manager.
]]> </description> <!-- Describe where the extension shows in the UI of the product --> <ui-access> <![CDATA[ ]]> </ui-access> <!-- Describe the files that comprise the extension --> <files> <file source="preloader.fla" destination="$flash/Components" /> </files>
</macromedia-extension>
NOTE
For more information on how the MXI file format is broken down, visit this web site.
You have now packaged your Preloader component in a file type that can be sent to any Macromedia Flash MX user. The final file can be sent to any person through e-mail, downloaded off a web site, or submitted to the Macromedia Exchange. Your component is now portable.
TIP
You can download and install dozens of components with the Extension Manager. You can find many at these three sites:
You now have a fully functional Preloader. To see how easy it is to now use this component, reopen a movie. Drag and drop the Preloader component from the Components panel on the movie. Without having to write any ActionScript, you add a Preloader.