Adobe 38039927 - Fireworks CS3 - PC Extended User Manual page 288

Extending fireworks
Hide thumbs Also See for 38039927 - Fireworks CS3 - PC:
Table of Contents

Advertisement

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.
ADOBE FIREWORKS CS3
284
Extending Guide

Advertisement

Table of Contents
loading

This manual is also suitable for:

Fireworks cs3

Table of Contents