FStyleFormat - Gradient?

Hi,

I was reading through one of my Flash books on Actionscript and it said you could do gradients programmatically. I was wondering if you can specify a linear gradient for a FStyleFormat value. For example:


     formStyleFormat.face = 0xFFFFFF; 

If you can, can you also specify whether the linear gradient goes side/side or up/down.

As far as I know, you can’t.

beginGradientFill() is how you create gradients in MX. And it is a drawing API thing.

Here is a thread where the beginGradientFill() method is used.

http://www.kirupaforum.com/showthread.php?s=&threadid=12042

(complicated eh?)

You can’t, but you could have a gradient shaped masked by some text to emulate that.

pom :cowboy:

i.e. put those two above posts together and you got yourself a winner :slight_smile:

Bringing out the big dogs for this question. I like it. Where would Kirupa be without you guys.

I was trying to be able to skin the comboBox component with a gradient face. Sounds like I challenge. I will probably be back with some more questions.

ilyaslamasse,

I didn’t understand what you meant by “gradient shaped masked”. Would you give me an example code?

no d, a gradient shape, masked by…

basically, have a gradient shape as a movieclip where your text is and set the mask of that gradient to be the text. Then the text has a gradient color.

Big dogs? :trout:

:stuck_out_tongue: