MACROMEDIA FIREWORKS 8-EXTENDING FIREWORKS Specifikace Strana 3

  • 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 2
191
EXTENDING FIREWORKS: DEVELOPING AN EFFECTIVE WORKFLOW USING JAVASCRIPT AND FLASH
All of these actions that you have performed are core actions (or combinations of actions) that
Fireworks supports. And, as we mentioned in the introduction, all of these core actions are exposed by
the Fireworks API and are accessible via JavaScript. This JavaScript can be housed in a JSF text file and
run via the
Commands menu, or it can be compiled into a SWF and run either as a modal command
window (again via the
Commands menu) or as a persistent Flash panel, accessible from the Window
menu like the
Align panel or Path panel.
Most of the Fireworks methods exposed via the Fireworks API perform actions on the selected object
(or objects). For example, the clipCopy() method assumes you have something selected on the can-
vas. Considering again your experience with Fireworks, this probably makes sense. You don’t apply a
filter to nothing; you apply it to the active selection.
Individually, the methods exposed via Fireworks are not that special. It’s their combination, however,
that can result in a very powerful, time- saving addition to the Fireworks toolset. Consider any operation
that you perform monotonously, and then consider the subtle variations you make in executing that task
each time. It’s the variations that can be extracted into a custom interface, acting as variables into your
repetitive task. You can then plug those variables into Fireworks API calls and reclaim some lost time.
So, with that basic overview out of the way, let’s get to it!
Defining a Fireworks workflow
Since this chapter is, after all, about workflow, how about defining one? Read and reread the following
workflow. The sections that follow will breathe life into these steps and give you a clear understanding
of each stage in the development process.
1. Create the JSF command file.
2. Create the UI (using Flash or Flex).
3. Import the JSF command text into the UI project.
4. Execute JSF commands in Flash or Flex using MMExecute().
5. Export/Publish the SWF and test it within Fireworks.
Let’s summarize that list in sentence form. Start by creating a JSF command and test that command
in Fireworks. Then, create a user interface using either Flash or Flex. Once you have your interface
in place, you need to have Fireworks execute your JSF command. This is achieved by calling the
MMExecute() method in ActionScript and passing it the JSF you want to execute. Once you have every-
thing in place in your UI, you publish a SWF to a special folder that Fireworks knows about.
That was the “trailer” paragraph. We hope you feel sufficiently enticed by the proposed workflow.
Now for the movie!
Step 1: Creating a simple JSF command
Let’s start by creating a simple JSF command. Without knowing any of the Fireworks API methods, you
can quickly create a JSF file using the Fireworks
History panel (select Window History from the main
menu).
191
Zobrazit stránku 2
1 2 3 4 5 6 7 8 ... 34 35

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

Žádné komentáře