MACROMEDIA FIREWORKS 8-EXTENDING FIREWORKS Specifikace Strana 10

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 35
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 9
198
CHAPTER 11
Adding the Mouse.onRelease event handler
With all of the pieces in place on the Flash stage, it’s now time to add an event handler to the button’s
onRelease event and execute the JSF:
1. Create a new layer in the timeline.
2. Change the layer name to Actions.
3. Lock the layer.
4. Open the Actions panel and add the following code to Frame 1 of the Actions layer:
executeJSF_btn.onRelease = function() {
MMExecute(jsfCode_txt.text);
}
When the button is clicked, MMExecute() will be called with the value of the TextBlock passed as the
argument.
Step 5: Publishing and testing the SWF
You’re now ready to publish your new command panel as a SWF and test it in Fireworks. This is the
exciting part! Refer to the “Commands vs. command paths” section earlier in this chapter to locate
the correct Command Panels folder for your operating system. Once you have the correct path, export
your current file as Draw Rect.swf to that location.
Because this is the first time you are exporting the file, you will have to restart Fireworks
in order to see the new command panel in the
Window menu of Fireworks. For subse-
quent exports, you can just close the panel in Fireworks and reopen it to see your latest
version.
Once you’ve restarted Fireworks, open the new panel from the main menu by selecting Window
Draw Rect
. You should now see your Execute JSF button in a new panel. Let’s test this thing! Create
a new document, and then click the
Execute JSF button. If you’ve followed along correctly, a new
rectangle should appear on the stage, just as it does when you select
Draw Rect from the Commands
menu.
Congratulations! You’ve now created your first custom Flash panel for Fireworks!
Change the publish path in Flash via File Publish Settings to the Command Panels
folder you just exported to. Publish by selecting
File Publish (press Alt+F+B to navi-
gate the main menu quickly) or by pressing Shift/Cmd+F12, all from the comfort of
your keyboard.
Zobrazit stránku 9
1 2 ... 5 6 7 8 9 10 11 12 13 14 15 ... 34 35

Komentáře k této Příručce

Žádné komentáře