Dağıtılan uygulamamı bir tarayıcıda test ettiğimde, açılır pencere kapatıldıktan sonra bile görüntülenmeye devam ediyor. istek sırayla profileEvt
dinamik gönderir isteğini işler benim dinlendirici web hizmeti, (görünüşte) ResultEvent
denir gönderilir: Şu anda biten budur ardından 4.Dağıtılmış esnek uygulama Web hizmeti sonuçlarının işlenmemesi
Flash Builder debug geldiğinde herşey beklendiği çalışmaları olarak görünüm durumunu değiştiren olay. Ancak, açılır pencere kapanmaz ve uygulama 'sıkışmış' olur.
Sorunun ne olabileceğini bilen var mı? Aşağıda esnek uygulaması web hizmeti olay dinleyicileri/eylemciler şunlardır:
webService.addEventListener(ResultEvent.RESULT, function(event:ResultEvent):void
{
var rawData:String = String(event.result);
var profileEvt:DynamicEvent = new DynamicEvent("profileSaved", true);
profileEvt.data = JSON.decode(rawData).profile;
dispatchEvent(profileEvt); // Dispatch profile saved event
_progressPopUp.closePopUp();
dispatchEvent(event); // Dispatch submit profile button clicked
});
webService.addEventListener(FaultEvent.FAULT, function(event:FaultEvent):void
{
Alert.show("Could not create profile; please try again later.\n" + event.message, "Status");
_progressPopUp.closePopUp();
});
var params:Object = {"profile" : profile};
try
{
_progressPopUp = PopUpManager.createPopUp(this, com.profs.ui.components.ProgressPopUp, true);
_progressPopUp.eventSource = webService; // Set source of progress events
webService.send(JSON.encode(params));
}
NOT: com.profs.ui.components.ProgressPopUp
özel bileşenidir;
<?xml version="1.0" encoding="utf-8"?>
<mx: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" layout="absolute" width="300" height="200" showCloseButton="false" title="Status" creationComplete="init()">
<fx:Declarations></fx:Declarations>
<fx:Script>
<![CDATA[
import mx.managers.PopUpManager;
[Bindable] public var eventSource:Object;
private function init():void
{
PopUpManager.centerPopUp(this);
}
public function closePopUp():void
{
PopUpManager.removePopUp(this);
}
public function completionHandler(event:Event):void
{
closePopUp();
}
]]>
</fx:Script>
<mx:ProgressBar id="progressBar" indeterminate="true" mode="event" source="{eventSource}" complete="completionHandler(event)" verticalCenter="0" horizontalCenter="0"/>
</mx:TitleWindow>