␡
- Defining an XML Structure
- Extending the UIComponent
- Tying It Together
- Getting More Depth
Like this article? We recommend
Tying It Together
With the XML structure and component created, all that needs to be done is to tie it together in the MXML file.
Listing 3 shows how this is done by adding a new Headline when the creationComplete event of the document is fired.
Listing 3: Tying it all together
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" backgroundColor="#ffffff" creationComplete="addHeadline();"> <mx:Script> <![CDATA[ import com.studiosedition.view.Headline; private function addHeadline():void { var headline:Headline = new Headline(’headlines.xml’, 5); addChild(headline); } ]]> </mx:Script> </mx:Application>