|
Comments
Did you read today's front page stories & breaking news?
SYS-CON.TV
|
Fireworks Creating Panels in Macromedia Fireworks
When it comes to designing and optimizing web graphics, it doesn't get much better than Macromedia Fireworks
By: Trevor McCauley
Feb. 10, 2006 11:15 AM
This new script combines each set of MMExecute commands into one. Replace it in Flash, republish, and retest:
right_btn.onRelease = function(){ Now using the Mirror panel should result in only one History step. With everything complete and working properly, there is one more concern that you may want to address: code reuse. Mirroring an object in Fireworks is a potentially useful action. If you should ever want to perform this action again, it would be helpful to have an easily reusable snippet of code that would let you do so. At this point, the code is pretty divided, having different implementations between four different buttons. Using a single function to represent a mirror in any direction would be useful and reusable. Such a function may look like the following:
function mirror(horiz, vert){ Where horiz and vert represent directions of mirroring. Passing the value (1, 0) to the mirror function mirrors to the left. Using (0, 1) mirrors to the bottom. Implemented in the Mirror panel, it looks like this:
var mirror = 'function mirror(horiz, vert){' You may notice that this script is back to using MMExecute twice again. It won't, however, create two steps in the History panel as the original version using two MMExecute commands for each mirror did. This is because Fireworks registers History steps from JavaScript commands only if there was some reaction made as a result of the executed command. Defining a function causes no such reaction so no History step is recorded. Actually, calling the function does cause the history to be recorded, so only the second call to MMExecute will result in a history step.
Where to Go from Here In Creating Fireworks Panels Part 2: Advanced Custom Panel Development, I cover a more complex example dealing with the advanced capabilities of custom panels in Fireworks. You will see how you can use the return result of MMExecute to dictate actions in Flash as well as learn how to create some more advanced interfaces for panels using some new features available in Studio 8. Part 2 to this article can be found at www.macromedia.com/devnet.
Reader Feedback: Page 1 of 1
Your Feedback
Latest Cloud Developer Stories
Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
|
SYS-CON Featured Whitepapers
Most Read This Week
Breaking Cloud Computing News
|
||||||||||||||||||||||||||||||||||||||||||||||||||||