
305
EXTENDING FIREWORKS
Rich symbols
Las
t
up
d
a
ted
12/8/2009
function setDefaultValues()
{
var currValues = new Array();
//to build symbol properties
currValues.push({name:"Selected", value:"true", type:"Boolean"});
Widget.elem.customData["currentValues"] = currValues;
}
function applyCurrentValues()
{
var currValues = Widget.elem.customData["currentValues"];
// Get symbol object name
var Check = Widget.GetObjectByName("Check");
Check.visible = currValues[0].value;
}
switch (Widget.opCode)
{
case 1: setDefaultValues(); break;
case 2: applyCurrentValues(); break;
default: break;
}
This sample JavaScript shows a rich symbol that can change colors:
function setDefaultValues()
{
var currValues = new Array();
//Name is the Parameter name that will be displayed in the Symbol Properties Panel
//Value is the default Value that is displayed when Rich symbol loads first time. In this
case, Blue will be the default color when the Rich symbol is used.
//Color is the Type of Parameter that is displayed. Color will invoke the Color Popup box
in the Symbol Properties Panel.
currValues.push({name:"BG Color", value:"#003366", type:"Color"});
Widget.elem.customData["currentValues"] = currValues;
}
function applyCurrentValues()
{
var currValues = Widget.elem.customData["currentValues"];
//color_bg is the Layer name in the PNG that will change colors
var color_bg = Widget.GetObjectByName("color_bg");
color_bg.pathAttributes.fillColor = currValues[0].value;
}
switch (Widget.opCode)
{
case 1: setDefaultValues(); break;
case 2: applyCurrentValues(); break;
default: break;
}
To better understand how the .JSF file can be used to customize symbol properties, explore the sample components
that have been included with the software.
Supported attributes for rich symbols
The following attributes are available in the Create Symbol Script panel (Commands > Create Symbol Script) for
customizing rich symbols.
Содержание 65011817 - Fireworks CS4 - Mac
Страница 1: ...Extending ADOBE FIREWORKS CS4...