The simple application menubar on the Flex3
by admin on 1 月.19, 2009, under FlexSDK3 Programming
I tried the example for Flex3 application menubar.
<?xml version="1.0"?>
<!-- containerslayoutsAppCBarSimple.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[ import mx.controls.Alert; ]]>
</mx:Script>
<mx:XMLList id="menuXML">
<menuitem label="File">
<menuitem label="New" data="New"/>
<menuitem label="Open" data="Open"/>
<menuitem label="Save" data="Save"/>
<menuitem label="Exit" data="Exit"/>
</menuitem>
<menuitem label="Edit">
<menuitem label="Cut" data="Cut"/>
<menuitem label="Copy" data="Copy"/>
<menuitem label="Paste" data="Paste"/>
</menuitem>
<menuitem label="View"/>
</mx:XMLList>
<mx:Array id="cmbDP">
<mx:String>Item 1</mx:String>
<mx:String>Item 2</mx:String>
<mx:String>Item 3</mx:String>
</mx:Array>
<mx:ApplicationControlBar id="dockedBar" dock="true">
<mx:MenuBar height="100%" dataProvider="{menuXML}" labelField="@label" showRoot="true"/>
<mx:HBox paddingBottom="5" paddingTop="5">
<mx:ComboBox dataProvider="{cmbDP}"/>
<mx:Spacer width="100%"/>
<mx:TextInput id="myTI" text=""/>
<mx:Button id="srch1" label="Search" click="Alert.show('Searching')"/>
</mx:HBox>
</mx:ApplicationControlBar>
<mx:TextArea width="300" height="200"/>
</mx:Application>The code was written by Adobe Flex documentation. The original code is here.
http://livedocs.adobe.com/flex/3_jp/devguide_flex3.pdf
Flex compile.
[root@hostname ~]# mxmlc myApplicationControlBar.mxml
Open the myApplicationControlBar.swf by web browser.
No comments for this entry yet...
Leave a Reply
You must be logged in to post a comment.