If you’ve ever wondered whether it’s possible to apply a gradient on a Flex Label, well it is ; but that’s not very straight forward… As I’m working on a app that requires this kind of glitter I decided to try and see what could be done.
I started with a basic ActionScript project (no Flex involved) and came up with this. Quite functional, could probably be optimized but my goal was actually a Flex component and I knew that was technically feasible. I then simply extended Flex’s Label class and basically copied/pasted the logic into it. Just had to figure out which event to listen to and I was good to go…
Here’s a demo app for your playing pleasure.
You may notice that in this example I embed the font so it looks nicer, but this is not mandatory…
All this is opensource (class+project) and you can grab it at my brand new Google Code dump: as3-bits. Help yourself.
As always, feedback welcome.