Flex关于超链接点击弹出事件mx:linkbutton
发布时间:2020-12-15 03:32:56 所属栏目:百科 来源:网络整理
导读:mx:LinkButton x="83" y="94" label="点击查看" click="khwzclickEvent()"color="#003399" textDecoration="none"/mx:LinkButton======================//点击超链接protected var customWin:titleWindow;//titleWindow弹窗public function khwzclickEvent()
<mx:LinkButton x="83" y="94" label="点击查看" click="khwzclickEvent()" color="#003399" textDecoration="none"> </mx:LinkButton> ====================== //点击超链接 protected var customWin:titleWindow;//titleWindow弹窗 public function khwzclickEvent():void{ //AppEvent.dispatch(AppEvent.WIDGET_RUN,46);// customWin = new titleWindow(); PopUpManager.addPopUp(customWin,this,true); PopUpManager.centerPopUp(customWin); } ======================= <?xml version="1.0" encoding="utf-8"?> <s:TitleWindow xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" width="773" height="596" close="onCloseWind()"> <fx:Script> <![CDATA[ import mx.managers.PopUpManager; /** * 关闭窗口; */ protected function onCloseWind():void{ PopUpManager.removePopUp(this); } /** * 移动窗口; */ protected function moveWindTo(location:String):void{ // 属性声明; var newX:Number = 0; var newY:Number = 0; var padding:Number = 10; // 居中显示: if(location == "center"){ PopUpManager.centerPopUp(this); return; } if(location.indexOf("bottom") > -1) { newY = (parent.height - this.height) - padding; } if(location.indexOf("top") > -1) { newY = padding; } if(location.indexOf("left") > -1) { newX = padding; } if(location.indexOf("right") > -1) { newX = (parent.width - this.width) - padding; } move(newX,newY); } ]]> </fx:Script> <fx:Declarations> <!-- 非可视元素 --> </fx:Declarations> <!--view--> <!--点击按钮可以移动弹窗 <s:VGroup horizontalCenter="0" verticalCenter="0" width="100%" height="100%"> <s:HGroup width="100%"> <s:Button id="tlBtn" label="左上角" width="100%" click="moveWindTo('toplet')"/> <s:Button id="trBtn" label="右上角" width="100%" click="moveWindTo('topright')"/> </s:HGroup> <s:VGroup width="100%" horizontalAlign="center"> <s:Button id="alignBtn" label="中间" click="moveWindTo('center')"/> </s:VGroup> <s:HGroup width="100%"> <s:Button id="blBtn" label="左下角" width="100%" click="moveWindTo('bottomleft')"/> <s:Button id="brBtn" label="右下角" width="100%" click="moveWindTo('bottomright')"/> </s:HGroup> </s:VGroup> --> <s:Image id="loader1" source="@Embed(source='assets/imageswmf/waterCer2.jpg')" height="100%" width="100%"/> </s:TitleWindow> ========================= (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |