Flex关于超链接点击弹出事件mx:linkbutton

前端之家收集整理的这篇文章主要介绍了Flex关于超链接点击弹出事件mx:linkbutton前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
	<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>
=========================

猜你在找的Flex相关文章