On the heels of my incredible crashing aqua button script, I thought I’d share a little undocumented JSFL stuff.
The reason the script was crashing has to do with the fill object in JSFL. The help lists four properties of this object:
color
colArray
posArray
style
style can be “solid”, “radialGradient” or “linearGradient”.
color is the color for a solid fill and colArray and posArray are for gradients.
The help doesn’t mention the matrix property, which is used to control the size and direction of the gradient.
Here’s the kicker though. When you define a fill, you must define all five properties on the fill object. That’s right. Even if you are making a solid fill, you need to define a colArray, posArray and matrix. You don’t, Flash dies a horrible death. No error message, just instant implosion.
On the pc, I could get away with not defining everything for a solid fill sometimes. Mac doesn’t like that at all though.
Another note on the matrix object. If matrix math isn’t your specialty, you’ll have a hard time figuring out what to enter for the a, b, c, d, tx and ty properties of the matrix object. It’s not exactly intuitive. So even if you don’t want to make aqua buttons, you might want to check out the aquabutton.jsfl file. There’s a function I came up with (with the help of Robin Debreuil) that takes x, y, width, height and rotation values and creates a matrix for you to use in the fill object.
Good catch!
It’s hard not to catch, hehe. Kind of hits you in the face, hard. BTW, this is the kind of stuff you’ll find in Extending Flash MX 2004. Go pick up your copies today!
Keith,
I’ll have to go and get myself a copy of this fine tome 🙂
BTW, on the extensioneering front (is that a word? lol) I’ve been pretty busy with some Flash Panels myself, some of which can be found at the following URL
http://www.phireworx.com/content/members/login.asp
Keep up the fantastic blog, and great work!