首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

在panel的titlebar下放置其他组件

2012-10-06 
在panel的titlebar上放置其他组件?xml version1.0 encodingutf-8?mx:Panelxmlns:mxhttp://www.

在panel的titlebar上放置其他组件

<?xml version="1.0" encoding="utf-8"?><mx:Panel  xmlns:mx="http://www.adobe.com/2006/mxml"  layout="vertical" creationComplete="init();"removedEffect="Fade" styleName="popUpPanel"   borderColor="#5C5C5C" width="150" height="150"><mx:Script><![CDATA[import mx.controls.LinkButton;import mx.controls.Button;import mx.containers.HBox;import mx.controls.Image;import mx.managers.PopUpManager;import mx.controls.Alert;[Embed(source="add.jpg")]private var addIcon:Class;private function init():void{var button:LinkButton = new LinkButton();button.setStyle("icon",addIcon);//button.height=16;button.addEventListener(MouseEvent.CLICK, buttonClick);//Create Hbox to add to title barvar titleHbox:HBox = new HBox();titleHbox.setStyle("horizontalAlign","center");titleHbox.width=this.titleBar.width;titleHbox.height=this.titleBar.height;//titleHbox.width=200;//Add image and button to HBox//button.label="add";//button.width=45;titleHbox.addChild(button);//Add Hbox with button and imagetitleHbox.label="testadd";this.titleBar.addChild(titleHbox);//center popup panel}//Function called when button is clickedprivate function buttonClick(event:Event):void{Alert.show('Button clicked now closing');PopUpManager.removePopUp(this);}]]></mx:Script></mx:Panel>
?

热点排行