Browse DevX
Sign up for e-mail newsletters from DevX


Master the Time-saving Power of Flash Components, Part 1 : Page 5

In Flash, components—drag-and-drop modules of assets and code—are frequently used to promote code reuse and conserve file size, but they're not always cross-version compatible. Find out how to build components that work across several versions of Flash.




Building the Right Environment to Support AI, Machine Learning and Deep Learning

Step 5: Manually Install and Test the Component
You're now done with the absolute basics and can test your work. To do this you need to install the component in the Components panel and try it out.

Figure 5. Roll over: After manual installation you should be able to see your component in the Components palette. If you added a tool tip string, you should also be able to see a tool tip when you roll over your component with your mouse.
First, select the component in the Library and go back to the "Component Definition..." window. Enable "Display in Components Panel" checkbox. Here, you can add a brief tool tip that will display when you roll over the component's icon in the Components panel. Next, click on the "Live Preview" Set button and switch to the embedded option. I left this file external throughout the testing phase for convenience. However, changing it to embedded will help reduce any possible problem of lost or incorrect pathnames when moving or copying the file on your drive.

Finally, quit Flash, copy the FLA file (not the SWF) to the Flash Configuration folder for your operating system, and place it in the "Components" directory:

For Windows operating systems:
Windows 2000 or XP: C:\Documents and Settings\user\Application Data\Macromedia\Flash MX\Configuration\Components
Windows 98 or ME: C:\Windows\Application Data\Macromedia\Flash MX\Configuration\Components
Windows NT: Windows directory\profiles\user\Application Data\Macromedia\Flash MX\Configuration\Components

For Macintosh operating systems:
Macintosh OS X: Hard Drive/Users/Library/Application Support/Macromedia/FlashMX/Configuration/Components
Macintosh System 9.x, single user: Hard Drive/System folder/Application Support/Macromedia/FlashMX/Configuration/Components
Macintosh System 9.x, multiple users: Hard Drive/Users/user/ Documents/Macromedia/FlashMX/Configuration/Components

Now you can restart Flash and your component should be in the Components panel (see Figure 5). When you roll over it you should see the tool tip you provided. Drag it to the stage and configure its lone property. Because of the Live Preview, the stage version should update immediately, without having to test your movie.

Coming up Next …
In part two of this article, coming in February, I'll show you how to make a custom interface for the Component Properties panel, how to add some new ActionScript to make your component more robust and easy to use, and how to add help and usage notes to Flash's Reference and Action panels. You'll even learn how to package your component for error-free distribution via the Macromedia Extension Manager.

Rich Shupe is President of FMA—a full-service multimedia development and training facility based in New York. FMA develops CD-ROMs and Web sites for clients including McGraw-Hill, Phillips, 20th Century Fox, and Nickelodeon, and trains digital media professionals in Flash, Director, JavaScript, and more.
Thanks for your registration, follow us on our social networks to keep up-to-date