Archive for category Flex4

Gradient background container with button as icon with states

 

<s:Group width=”170″ height=”20″>
<s:Rect left=”0″ top=”0″ right=”0″ bottom=”0″>
<s:stroke>
<s:SolidColorStroke color=”#e9e9e9″ />
</s:stroke>
<s:fill>
<s:LinearGradient rotation=”-90″>
<s:GradientEntry color=”#cccccc” ratio=”.4″ />
<s:GradientEntry color=”#eeeeee” />
</s:LinearGradient>
</s:fill>
</s:Rect>
<s:Label left=”5″ right=”5″ top=”2″ bottom=”2″
text=”title” fontSize=”10″
verticalAlign=”middle” />
<s:Button width=”10″ height=”10″ right=”8″ top=”3″
buttonMode=”true” click=”clickHandler(event)”
skinClass=”ButtonIconSkin”/>
</s:Group>

 

ButtonIconSkin.mxml

<?xml version=”1.0″ encoding=”utf-8″?>
<s:Skin xmlns:fx=”http://ns.adobe.com/mxml/2009&#8243;
xmlns:s=”library://ns.adobe.com/flex/spark”
xmlns:mx=”library://ns.adobe.com/flex/mx”>
<!– host component –>
<fx:Metadata>
[HostComponent(“spark.components.Button”)]
</fx:Metadata>

<!– states –>
<s:states>
<s:State name=”disabled” />
<s:State name=”down” stateGroups=”stateUp” />
<s:State name=”over” />
<s:State name=”up” stateGroups=”stateUp” />
</s:states>

<s:Group visible.stateUp=”false” visible=”true” buttonMode=”true”>
<s:BitmapImage source=”@Embed(‘../images/icon_maximize_up.png’)” />
</s:Group>
<s:Group visible.stateUp=”true” visible=”false” buttonMode=”true”>
<s:BitmapImage source=”@Embed(‘../images/icon_maximize_normal.png’)” />
</s:Group>
</s:Skin>

 

Advertisements

, ,

Leave a comment

Center tag: keep everything in middle

<html>

<body>

<center>

… put any content, it will be aligned in the center of browser page
… I think we have to keep content size lesser than browser size
to fit into middle
</center>

</body>

</html>

 

 

 

Leave a comment

Flex : Find the URL of the Server / Local file location based on the Application server type

This code is used to find the URL of the Server / Local file location based on the Application server type (java, php,.. / none).

– by Abdul

Leave a comment

Drawer – Flex 4 Component

Preview of Drawer component can be found here

Source code of Drawer component can be found here

Leave a comment

Create Adobe AIR project with .as file as main application

– check out the site to know how we can remove the default mainapplication.mxml and use mainapplication.as in Adobe AIR project

Leave a comment

2 way binding in Flex4

Binding between two properties in Flex 4 is insanely easy now.
Instead of just using “{}”, now you can add an @ to make it go both ways: “@{}”.
In example, you’ll see the @ in the text property of the second TextArea which will two-way bind with the text property of the first TextArea.

Leave a comment