Search Flex Components Free

Custom Search

December 27, 2007

MXML & AS correlations

MXML is the powerful way to simplify the creation of user interfaces.

For example:

In MXML file for creating a button:

<mx:Button x=”166″ y=”56″ id=”btn” label=”Click Me”/>

In AS file for creating a button:

var btn:Button=new Button();

btn.label=”Click Me”;

“Lets see one more example:”

MXML file:

<?xml version=”1.0″ encoding=”utf-8″?>

<mx:Application xmlns:mx=”” layout=”absolute”>

<mx:Button id=”btn”/>


AS file:



import mx.core.Application;

import mx.controls.Button;

public class example extends Application{

internal var btn:Button;

public function example(){


btn=new Button();





Related Flex Tutorials