Creating Custom Flash ButtonsWith Flash Objects, introduced in Dreamweaver 4, Macromedia brought together two of its most powerful technologies. True to their underlying philosophy of extensibility, the Dreamweaver engineers provided an architecture for addressing Flash rather than just a feature. The implementation of Flash Objects included Flash Text and Flash Buttons; however, the architecture is capable of much more. One company, WebAssist (www.webassist.com), exploited this functionality to develop a commercial extension, Flash Charts, in several variations. All Flash Objects are based on Generator templates that are created in Flash 5. Dreamweaver uses the templatesrecognizable by their .swt file extensionto create new Flash movies that use the .swf extension. The Generator templates have variables embedded in the Flash movies, such as {Button Font} . These variables are replaced by user -specified values when a Flash Object is inserted into Dreamweaver. Dreamweaver includes a fair number of Flash Buttons and Flash Text objects in the standard version of the program, and numerous other Flash Button collections are available on the Dreamweaver Exchange. Although these examples work fine, a custom-tailored solution is required occasionally, and clip-artno matter how well executedis not acceptable. Such custom Flash ObjectsFlash Buttons and Flash Textare created in Flash 5 with the aid of the Generator Authoring Extensions. NOTE Starting with Flash MX, Macromedia no longer includes support for Generator in Flash; however, you can still output Generator templates with Flash 5. Because Dreamweaver MX still includes Flash Objects, if you want to create custom Flash Buttons, you need to have Flash 5 available. The Generator Authoring Extensions for Flash 5 are available on the Macromedia site. As of this writing, you can find these extensions at www.macromedia.com/software/generator/download/extensions.html. There are a number of versions, corresponding to the different versions of Generator; make sure you download the proper version for your system. Although it's possible to make Flash Text templates, they are not used as frequently as Flash Buttons. The following procedure, which is specific to Flash Buttons, can easily be adapted to make a Flash Text template. Preparing custom Flash Buttons is really a six-stage process, half of which takes place in Flash and half of which takes place in Dreamweaver:
NOTE To add text variables in a Generator template, you need the Insert Text Generator object. The Insert Text object is a custom object created by Mike Chambers of Macromedia. It is currently available on the Flash Exchange at www.macromedia.com/exchange/flash. The technique described in this section assumes that you are familiar with building buttons in Flash and inserting Flash Buttons in Dreamweaver. As with standard buttons built in Flash, your graphic should be converted to a button-type symbol, and it can use all four keyframes: Up, Over, Down, and Hit. After you've built the button, follow these steps to add the Generator functionality:
Now let's switch to Dreamweaver to complete the custom Flash Button. Choose Insert > Interactive Images > Flash Button, or select the Flash Button symbol from the Insert bar's Media category to open the Flash Button dialog box. As shown in Figure 8.2, the button is blank and displays no sample text. Figure 8.2. The Flash Button dialog box is used to create its own previews.
To create an accurate preview that includes the sample text, follow these steps:
The next time the Flash Button object is accessedDreamweaver does not need to be restartedthe custom template will display a full preview, with text and preset values. |