MACROMEDIA FIREWORKS 8-EXTENDING FIREWORKS Especificaciones Pagina 26

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 35
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 25
214
CHAPTER 11
The changes here are minor and no different than any ActionScript 2 to ActionScript 3 migration.
With the event handlers in place and assigned, this FLA can be published and executed in Fireworks.
The functionality should be equivalent between the two. Note that MMExecute(jsfCode) has remained
the same. Since ActionScript 3 supports the include statement, our workflow has remained relatively
unchanged.
Responding to Fireworks events in ActionScript 3
Responding to Fireworks events in ActionScript 3 is a bit more structured than in ActionScript 2.
Whereas in ActionScript 2 you simply define a function with the name of the event, in ActionScript
3 you must register an event handler for the events you want to listen to (just like we registered
event handlers for our buttons using addEventListener). The following code shows how to register
Fireworks events using the ExternalInterface object:
// Constructor
public function DrawRect()
{
// Register all Fireworks Event Handlers
ExternalInterface.addCallback("IsFwCallbackInstalled",
IsFwCallbackInstalled);
ExternalInterface.addCallback("onFwActiveToolChange",
onFwActiveToolChange);
ExternalInterface.addCallback("setfwActiveToolForSWFs",
setfwActiveToolForSWFs);
ExternalInterface.addCallback("onFwActiveSelectionChange",
onFwActiveSelectionChange);
}
// Fireworks calls IsFwCallbackInstalled whenever an event is generated
// Return true when you wish to handle the event.
function IsFwCallbackInstalled(funcName:String):Boolean
{
switch( funcName )
{
case "onFwActiveToolChange":
return true;
case "setfwActiveToolForSWFs":
return true;
case "onFwActiveSelectionChange" :
return true;
default :
return false;
}
}
Vista de pagina 25
1 2 ... 21 22 23 24 25 26 27 28 29 30 31 ... 34 35

Comentarios a estos manuales

Sin comentarios