Flex概要-ハイパーリンククリックポップアップイベントmx:linkbutton

3539 ワード

	<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>
=========================