The Flex application, when deployed onto the web, is wrapped up inside an html page that takes care of detecting whether or not the user has the correct version of the Flash Player installed and, if required, can prompt the user to update their Flash Player. Here is a simple Flex application that displays a message on a button click event, MXML is an XML based language, and as such uses namespaces, the most important one ? mx ? is bound via the xmlns URI in the application tag and refers to the Flex framework classes:
xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal" >
import flash.events.MouseEvent;
private function clickHandler ( event:MouseEvent ):void { Label1.text = "Flex application in Visual Studio 2008"; } ]]>
title="My Application" horizontalAlign="center" paddingTop="10" paddingBottom="10" paddingLeft="10" paddingRight="10" >
The important tag worth mentioning here is '...../'. This is the defining container for the whole application. One can also customize the look of the application by adding style sheet. Just add a new file (.css) to 'src' folder and add these lines:
Building Flex Apps using VS is quite simple, one can see different components of the Flex project in Solutions Explorer; one also gets benefit of intelliSence.
/* CSS file */ Application { background-color:Olive;
}
Now add the following tag to 'FlexusingVS.mxml' file:
Here is the output of a sample Flex application. To view the output one needs to have Flash Player plug-in installed in browser.
It is evident from the above sample that using VS IDE for building Flex apps is one of the most efficient ways of doing the task, specially for those web developers who are already using VS and are not comfortable with any other IDE.
Get most out of your technology infrastructure investments with Dell
About CIOL | Media Kit | Site Map | Contact Us | Help | Write to us | Jobs@CyberMedia | Privacy Policy
Copyright © CyberMedia India Online Ltd. All rights reserved. Usage of content from web site is subject to Terms and Conditions.