Without a doubt, the Fireworks extensibility model is quite robust. What's the best way to get a handle on it all especially for someone coming from a Dreamweaver background? Short answer: the History panel. The History panel in Fireworks records actions taken to create Fireworks graphics. Like Dreamweaver's History panel, selected steps can be saved as a command to be executed at will. More importantly for our purposes, selected steps can also be copied to the Clipboard and then pasted into a text editor for examination and modification. I use this technique to create most of the core Fireworks routines for my extensions. How do you apply this technique? As an example, let's say that as part of a new extension, you want to create a star-shaped graphic with a variable number of points. Here's how I would approach the problem:
To test a series of different values without modifying the .jsf file each time, set your variable to accept a prompt value, like this: thePoints = prompt("Enter the number of points",""); This results in a prompt dialogFireworks' only native method of accepting user input outside of its new Flash user interface commandsas shown in Figure 7.8. Figure 7.8. Prior to Fireworks MX, user interfaces for native Fireworks commands were limited to simple prompts like this one. In Fireworks MX, commands may employ a Flash user interface.
Any of the addNewStar() function's arguments can be set up for user interaction as seen in Figure 7.9. Figure 7.9. Test your Fireworks functions interactively by setting a parameter equal to a prompt() function call. This page shows three stars created by using the command described in this sectionwith five, six, and seven points respectively and the preparation for a fourth star with eight points. The gradient fill is picked up from a previous selection; however, the drop shadow effects were added later.
Not all arguments are as straightforward as our example, however. The star's position is given as the object's center point, rather than the top-left corner of the bounding rectangle shown in the Property inspector or the Info panel. Still, with a little effort, you can control virtually every aspect of Fireworks' drawing tools, which can add significantly to Dreamweaver's functionality. |