MXML vs.

( apples vs apples )
Ted Patrick - Adobe Systems

MXML Tags are instances of ActionScript 3 Classes.
<mx:Button id=”foo”/> var foo:Button = new button();

MXML === AS3 Class
• MXML is translated to an AS3 Class • 100% compatible • 100% the same

MXMLC Compiler
• MXML to ActionScript 3 Classes • ActionScript 3 to ABC Bytecode • ABC Bytecode to SWF • SWF run within Flash Player 9

• Manages Component Creation • Manages Component Layout • Manages Component Destruction

MXML Advantage
• MXML makes composition simple. • MXML makes data binding simple. • MXML is easy read and code. • MXML is XML

Pop the MXML hood
• -keep-generated-actionscript • -keep


(dare I say it) HACK MXML

MXML/AS3 Components
• Custom components in ActionScript 3 • Custom components in MXML

Code-Behind in MXML
• MXML inherits from an ActionScript Class • All members are available in MXML • Code and Layout are separate. • Whirled Peas!

MXML via new
• 100% legal to instantiate MXML classes via
new contructor

• Use MXML instances as DisplayObjects via
addChild and removeChild

Singleton in MXML
• I want one and only one Settings Panel!!! • SettingPanel.getInstance(); • Handy with PopUpManager!

Inheritance Madness
• MXML extending AS3 • AS3 extending MXML • More Whirled Peas!

DOM Events
• Flash Player 9 implements DOM Events • Mouse Events travel across the DisplayList • Capture - Root to Target. • Target - The event arrives. • Bubble - Target to Root.

Sign up to vote on this title
UsefulNot useful