我有以下自定义事件:
package com.un.photoManager.events
{
import flash.events.Event;
import mx.collections.ArrayCollection;
public class CreateAlbumFolderEvent extends Event
{
// when creating an album, we need to know which albumfolder to put it in, 0 is the default group;
public var albumFolderID:int = 0;
public var name:String;
public function CreateAlbumFolderEvent(type:String, name:String, albumFolderID:int = 0, cancelable:Boolean = false)
{
super(type, true, cancelable);
this.name = name;
this.albumFolderID = albumFolderID;
}
}
}
使用以下代码从弹出窗口调用该事件:
protected function handleCreate():void
{
var event:CreateAlbumFolderEvent;
var selectedItemType:String;
if (folderAlbum == CREATE_ALBUM)
{
event = new CreateAlbumFolderEvent(EventConstants.CREATE_ALBUM, newAlbumFolder.text, selectedAlbumFolderID);
selectedItemType = "Album";
}
else
{
event = new CreateAlbumFolderEvent(EventConstants.CREATE_ALBUM_FOLDER, newAlbumFolder.text);
selectedItemType = "Folder";
}
dispatchEvent(event);
FolderBrowse.lastSelectedItemType = selectedItemType;
PopUpManager.removePopUp(this);
}
我要做的是捕获返回的响应。这是显示响应的查尔斯的屏幕截图。Result 值是我希望在dispatchEvent(event);
执行后能够使用的值。
我已经为此工作了几个小时,查看博客和论坛帖子,但无法找到可行的解决方案。理想情况下,代码示例会很好,但现在任何帮助都将不胜感激。