View Single Post
  #1 (permalink)  
Old 08-02-2007, 03:44 AM
Karpagarajan Karpagarajan is offline
D-Web Analyst
 
Join Date: Mar 2007
Posts: 299
Karpagarajan is on a distinguished road
Thumbs up Adobe Flex Tips & Tricks

Hi All,

I have started this thread for flex tips and tricks. I have faced the problem of finding a specific functionality or keywork in a particular development environment in a particular thread. I dont find the tips and tricks in a particular thread. So I have started this thread which is going to have all the flex tips and tricks in a particular place. So that it will be easy to search in this thread for a particular thing. Hope it will be helpful for your flex development.

Ok, Here i am going to explain about a simple tricks how we can set the style of the flex application window.

STYLE

Flex defines styles for setting some of the characteristics of components, such as fonts, margins, and alignment. These are the same styles as defined and used with Cascading Style Sheets (CSS).
The UIObject and UIComponent classes define the global styles available for all components. In addition, each component can define its own styles.

You can set all styles in MXML as tag properties. Therefore, you can set the margins for a Box container using the following syntax:
<mx:VBox id="myVBox1" marginTop="12" marginBottom="12" />
<mx:Button label="Submit"/>
</mx:VBox>
You can also configure styles in MXML using the <mx:Style> tag, or in ActionScript using the setStyle() method. The <mx:Style> tag contains style declarations using CSS syntax or a reference to an external file that contains style declarations, as the following example shows:
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml">
<mx:Style>
.myClass { horizontalAlign: "left";}
Box { marginTop: "12"; marginBottom: "12";}
Tile { verticalGap: "10"; horizontalGap: "10";}
</mx:Style>
<mx:VBox id="myVBox1" />
<mx:Button label="Submit"/>
</mx:VBox>
<mx:VBox id="myVBox2" styleName="myClass" />
<mx:Button label="Submit"/>
</mx:VBox>
</mx:Application>
thanks
__________________
Karpagarajan. R
Necessity is the mother of invention

Last edited by Karpagarajan : 08-02-2007 at 03:47 AM.
Reply With Quote
Sponsored Links