MACROMEDIA FIREWORKS 8-EXTENDING FIREWORKS Spezifikationen Seite 15

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 35
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 14
203
EXTENDING FIREWORKS: DEVELOPING AN EFFECTIVE WORKFLOW USING JAVASCRIPT AND FLASH
Figure 11‑8. ColorPicker MovieClip added
to the stage
With the MovieClip in place on the stage, add an event handler for its onRelease event and call
fw.popupColorPickerOverMouse() via MMExecute(). MMExecute() will return a color value in the
#RRGGBBAA format that can then be passed to the SetColor method defined on ColorPicker_mc.
Following is the ActionScript event handler for ColorPicker_mc.onRelease:
var currentColor:String = "#FF0000";
colorPicker_mc.onRelease = function()
{
currentColor = MMExecute("fw.popupColorPickerOverMouse('" +
currentColor + "',false,false);");
colorPicker_mc.SetColor(currentColor);
}
The popupColorPickerOverMouse method accepts three parameters: initialColor, allowTransparent,
and forceWeb216. The resulting value is stored in the variable currentColor and passed directly to the
SetColor method of ColorPicker_mc. The following code demonstrates how the SetColor method
works with the Fireworks- returned color value. Like many values returned from Fireworks (or Flash
values going to Fireworks), the value has to be massaged into a format that makes sense to Flash.
function SetColor(color:String)
{
rectTarget_mc.clear();
rectTarget_mc.moveTo(0,0);
rectTarget_mc.beginFill(parseInt("0x" + color.substr(1, 6)), 100);
rectTarget_mc.lineTo(22,0);
rectTarget_mc.lineTo(22,22);
rectTarget_mc.lineTo(0,22);
rectTarget_mc.lineTo(0,0);
rectTarget_mc.endFill();
}
Seitenansicht 14
1 2 ... 10 11 12 13 14 15 16 17 18 19 20 ... 34 35

Kommentare zu diesen Handbüchern

Keine Kommentare