
313
EXTENDING FIREWORKS
Rich symbols
Las
t
up
d
a
ted
12/8/2009
textOnly
String. If defined, this represents the entire MXML output to be used for the export. If this is defined, no other
properties need to be set within the definition. Any properties set are ignored.
Example
textOnly = "<mx:ColorPicker id=\"cp\" selectedColor=\"#FFFFFF\"/>";
ignored
Boolean. If true, the object is completely ignored during export; no MXML is created and no image is exported. If this
is set to true, no other properties need to be set within the definition. Any properties set are ignored.
Note:
The
ignored
property has precedence over
textOnly
.
Example
ignored = true;
Example script
The following is an example of a custom symbol script using a custom definition object to determine the output created
by the Fireworks MXML and Images export.
function setDefaultValues() {
var currValues = new Array();
currValues.push({ name:"name", type:"Text", value:"star name" });
currValues.push({ name:"label", type:"Text", value:"Star" });
currValues.push({ name:"color", type:"Color", value:"#FFFFFF" });
currValues.push({ name:"enabled", type:"Boolean", value:"true" });
Widget.elem.customData["currentValues"] = currValues;
Widget.elem.customData["flexClassName"] = "Star";
var classDef = new Object();
classDef.margin = {top:0, right:3, bottom:10, left:3};
classDef.padding = {top:30, right:10, bottom:10, left:10};
classDef.sizeOffset = {width:10, height:0};
classDef.customValues = {staticValue:"static"};
classDef.attributeProperties = ["staticValue", "name"];
classDef.styleProperties = ["color"];
classDef.defaultProperties = ["x","y","width","height"];
classDef.namespace = {ns:"http://www.example.com/2007/mxml"};
Widget.elem.customData["flexClassDefinition"] = classDef;
}
function applyCurrentValues() {
var vals = Widget.elem.customData["currentValues"];
Widget.GetObjectByName("label").textChars = vals[1].value;
Widget.GetObjectByName("label").pathAttributes.fillColor = vals[2].value;
Widget.GetObjectByName("disabled").visible = !vals[3].value;
}
switch (Widget.opCode) {
case 1: setDefaultValues(); break;
case 2: applyCurrentValues(); break;
}
A document containing this rich symbol that is exported using the MXML and Images export would result in the
following MXML document.
Содержание 65011817 - Fireworks CS4 - Mac
Страница 1: ...Extending ADOBE FIREWORKS CS4...