다음 코드를 사용하여 열린 팝업 창이 닫히지 않았는지 확인할 수 있습니다. 닫히면 타이머를 중지 할 수 있습니다. 당신은 팝업 창을 열 때
private function checkPopUpExistance():void
{
call closePopUpWindow() function for every 1 sec or any seconds(your wish) to check whether popup is exist or not.
if(isPopupExist)
{
here you stop the timer.
}
}
당신의 타이머에
//set the flag to find your popup window is exist or not.
private var isPopupExist:Boolean = false;
private function closePopUpWindow():void
{
var systemManager:SystemManager = FlexGlobals.topLevelApplication.systemManager;
//Returns a list of all children.
var childList:IChildList = systemManager.rawChildren;
for(var i:int=childList.numChildren-1;i>=0;i--)
{
var childObject:* = childList.getChildAt(i);
//If child object is Uicomponent.
if (childObject is UIComponent)
{
var uiComponent:UIComponent = childObject as UIComponent;
//If uicomponent is popup and class name is equal to **your popup component name** here i am using "ChatComp".
if (uiComponent.isPopUp && uiComponent.className == "ChatComp")
{
isPopupExist = true;
}
}
}
}
은 지금 당신은 타이머를 시작할 수 있습니다.
출처
2013-06-17 06:54:15
Gva
당신은 당신 자신의 질문에 대답 했습니까? ;) Events FTW – RIAstar
나는 당신의 질문을 이해하지 못했을 지 모르지만, 당신은 팝업창이 닫혔는지 알아야 할 필요가있는 것처럼 보입니다. 그럴 경우, 창이 닫혀 있는지를 알아야합니다. 내 질문은 너의 창문을 어때? 단추를 추가하고 해당 단추에 클릭 핸들러를 등록하는 일반적인 방법은 팝업 관리자를 호출하여 창을 닫는 것입니다. 그거하지 않니? –
예, PopUpManager.removePopUp (this)을 사용하고 있습니다. –