'2009/07'에 해당되는 글 6건
- 2009/07/08 Flex Skin Design Extensions & Flex Component Kit for Flash CS3
- 2009/07/08 PPT 파일
- 2009/07/08 7월 7일차 소스코드
- 2009/07/06 7월 6일 수업 소스코드 (커스텀 컴포넌트)
- 2009/07/03 3일차 실습 소스코드 (Naver 책 검색)
- 2009/07/03 Popup에서 함수 호출하기
분류없음2009/07/08 11:27
분류없음2009/07/08 08:54
분류없음2009/07/06 12:57
분류없음2009/07/03 13:01
분류없음2009/07/03 11:03
PopUpManager Tip
주제: 팝업을 호출하고, 호출된 팝업에서 호출한 부모의 변수나 함수를 호출하는 방법
PopupCaller
- <?xml version="1.0" encoding="utf-8"?>
- <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" verticalAlign="top" horizontalAlign="center" fontSize="12">
- <mx:Script>
- <![CDATA[
-
import mx.controls.Alert;
- import mx.managers.PopUpManager;
- private function showWindow():void {
- var login:myPopup=myPopup(PopUpManager.createPopUp( this, myPopup , true));
- login.loginName=returnedName;
- login.testFunc = test;
- }
- public function test(value:String):void
- {
- mx.controls.Alert.show(value, "test");
- }
- ]]>
- </mx:Script>
- <mx:Panel title="팝업 호출하는 곳" layout="vertical" horizontalCenter="0" verticalCenter="0">
- <mx:Text id="returnedName" width="100%" text="팝업이 사용할 곳..."/>
- <mx:ControlBar>
- <mx:Button id="myButton" label="팝업 띄우기" click="showWindow()" width="100%"/>
- </mx:ControlBar>
- </mx:Panel>
- </mx:Application>
PopupCallee
- <?xml version="1.0" encoding="utf-8"?>
- <mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml" title="팝업 창"
- showCloseButton="true" close="PopUpManager.removePopUp(this)">
- <mx:Script>
- <![CDATA[
- import mx.managers.PopUpManager;
- import mx.controls.Text;
- public var loginName:Text;
- private function returnName():void {
- loginName.text="이름: " + userName.text;
- PopUpManager.removePopUp(this);
- }
- public var testFunc:Function;
- private function callFunction():void
- {
- testFunc(userName.text);
- }
- ]]>
- </mx:Script>
- <mx:HBox>
- <mx:Label text="이름:"/>
- <mx:TextInput id="userName" width="100%"/>
- </mx:HBox>
- <mx:ControlBar>
- <mx:Button label="확인" click="returnName();"/>
- <mx:Button label="호출" click="callFunction()"/>
- </mx:ControlBar>
- </mx:TitleWindow>
CustomEvent.zip