MACROMEDIA FIREWORKS 8-EXTENDING FIREWORKS Manual page 114

Table of Contents

Advertisement

3.
In the first frame, add the following in the Actions panel to link the general fireworks stub
file to the movie when it is published:
#include "fwstubs.as"
4.
Create a simple button which will activate the RPC script.
5.
Insert the button in the first frame, in the middle of the Stage.
6.
Attach the following ActionScript code to the button to activate the RPC code when the
button is clicked:
on(press){
RPCMethods.CreateAutoReleasePool();
var fw = new Fireworks();
//Hide all panels - this function commented out as it will crash if run
from inside Fireworks
//fw.setHideAllFloaters(true);
//Define the document objects the long way
var res = new Object();
res.units = "inch";
res.pixelsPerUnit = 72;
var size = new Object();
size.x = 220;
size.y = 220;
//Create new doc
var fwdoc = fw.createFireworksDocument(size, res, "#0033FF");
//Define a rectangle object the short way
var rect = {left:10, top:10, right:210, bottom:210};
//Add Rectangle
fwdoc.addNewRectanglePrimitive(rect,0.20);
//Set its color
fwdoc.setFillColor("#00CC99");
RPCMethods.DestroyAutoReleasePool();
}
RPCMethods.DestroyAutoReleasePool();
7.
Publish the SWF file.
When you publish the SWF file, make sure the stubs files are in the same directory as your
FLA file.
114
Cross-Product Extensions

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FIREWORKS 8-EXTENDING FIREWORKS and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Fireworks 8

Table of Contents