PDA

View Full Version : FStyleFormat - Gradient??



andrthad
January 20th, 2003, 05:36 PM
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.

lostinbeta
January 20th, 2003, 05:42 PM
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?)

pom
January 20th, 2003, 06:36 PM
You can't, but you could have a gradient shaped masked by some text to emulate that.

pom :cowboy:

senocular
January 20th, 2003, 06:38 PM
i.e. put those two above posts together and you got yourself a winner :)

andrthad
January 20th, 2003, 06:48 PM
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?

senocular
January 20th, 2003, 06:51 PM
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.

pom
January 20th, 2003, 07:01 PM
Big dogs? :trout:



:P