#1 Flex Hack – VBox,HBox with gradient background

Filed under Actionscript, Flex, Flex Beyound basic, Flex Hacks

It’s hard to find good resources or techniques for Flex Hacks, I will start from today a category on this blog for flex hacks, the first one is about the adding background gradient way in VBox and HBox which I guess why still doesn’t is by default.

Level of Hack: Easy
To: All Flex devs

Description:

I want to put a gradient color on my vbox container and hbox either, but is not allowed, with this hack you can, just simple as possible.

How:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:ns1="office.menu.*">
<mx:Style>
		.testeGradiente{
			fillColors: #444444, #ffffff;
			fillAlphas: 0.1,1;
		}
</mx:Style>
 
	<mx:VBox styleName="testeGradiente" borderStyle="applicationControlBar" x="101" y="46" width="174" height="170">
	</mx:VBox>
 
 
</mx:Application>

Explanation:

Since the components are shared the same classes or aka (inheritance ), you can take a hole possible new hacks on that and use same as applied for others containers.

The property I used to enable this was the borderStyle which I applied the same name as in the component applicationControlBar.

That’s all folks. Next hack to come.

3 Comments

  1. valley
    Posted August 11, 2008 at 4:50 am | Permalink

    Good idea. What’s missing now is a visual example of what you’ve done (as this is done at blog.flexexamples.com).
    I hope that this series will be as informative as the one at flexexamples.com, perhaps leaving more the documented paths of Flex, i.e. hacks ;-)

    Cheers
    valley

  2. Sid
    Posted September 20, 2009 at 4:20 am | Permalink

    Hey, it’s cool. Thanx for the hack. I like hackers since I am no different. I modified the tech as necessary and applied in many places … Flex needs lots of hackers going ahead, I guess.

  3. dev
    Posted February 10, 2010 at 2:04 am | Permalink

    awesome dude!! keep it up

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*