Groups | Blog | Home
all groups > flash exchange extensions > october 2005 >

flash exchange extensions : jsfl first timer


robotstyle
10/22/2005 8:29:14 PM
I'm just starting to use jsfl to extend flash but have quickly run into a
problem. The following command saved as "New Color" in Configuration\Commands
folder works:

var fill = fl.getDocumentDOM().getCustomFill();
fill.color = '#FF0000';
fill.style = "solid";
fl.getDocumentDOM().setCustomFill(fill);

However the following doesn't:

var fill = fl.getDocumentDOM().getCustomFill();
fill.style = "linearGradient";
fill.colorArray = [ 0x00ff00, 0xff0000, 0x0000ff ];
fill.posArray = [0, 100, 200];
fl.getDocumentDOM().setCustomFill( fill );

What am I doing wrong?

Regards, Mike.
robotstyle
10/23/2005 12:00:00 AM
It seems to work when I draw a shape using the brush tool, select it, and then apply the command.

Why will it not work when nothing is selected? Am I missing something? Thanks.
Michael Gioffredi
11/24/2005 12:00:00 AM
Finally figured it out, here is a working version that does not require a
selection:

var fill = fl.getDocumentDOM().getCustomFill("toolbar");
fill.style = "linearGradient";
fill.colorArray = [ 0x00ff00, 0xff0000, 0x0000ff ];
fill.posArray = [0, 100, 200];
fl.getDocumentDOM().setCustomFill( fill );
AddThis Social Bookmark Button