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
