Monday, April 21, 2008

Gradient on Dynamic Text

text_mc.myText_txt.text ="this text has a gradient";
mask_mc.setMask(text_mc);

Put 'mask_mc' (which is a box with a gradient) on the layer under text_mc.

7 comments:

esjay said...

Thanks ... thats a nice workaround.

shaman4d said...

Great thank you.

nate said...

You're welcome.

khaos119 said...

Isn't this line backwards? mask_mc.setMask(text_mc);


shouldn't it be text_mc.setMask(mask_mc);

Just noticed, thanks for the help tho!

nate said...

No. If anything I just have them labeled wrong. text_mc will indeed become the mask so the gradient box shows through, giving the illusion of gradient text. This doesn't work anymore with CS4, though.

khaos119 said...

Do you know how to do it with CS4? I'm having trouble finding anything.

ActiveMediaSystems said...

It's been simplified in AS3 CS4.

mask_mc.mask = textBoxtxt;

where mask_mc is a movieclip with a gradient fill in it and textBoxtxt is a dynamic textbox.