Thursday, March 15, 2007
Flex LinkButton : Transparent Backgrounds?
For a current project I have a container which has a gradient background. Within this I have a series of LinkButtons. I only want the text color of the LinkButton to change on rollOver. If the background of the container was solid I could set the rollOver color to match the background. But the gradient makes this impossible. So I went to the styles for LinkButton expecting to find a backgroundAlpha property. But it seems the LinkButton lacks this or any similar style that I could use. It took me a little while to realise there is a relatively simple solution. Which is to create a skin with a transparent background and to use this for the LinkButton's overSkin and downSkin. I already had a few skins that I was embedding from a swf so I just created a new movieClip which contained a transparent object and added a linkageID of clear_bg. Exported the swf and defined a new style for my LinkButtons. Simple and yet effective. I'd love to hear if there was a style I could have used to get the same result.