flex:从 popUp 引用调用对象

发布于 2024-11-08 11:32:48 字数 555 浏览 0 评论 0原文

我遇到的情况是,屏幕上有一些图像,并分配了业务属性(值、数量、质量等级)。当我单击它们时,需要打开一个弹出窗口,并允许我更改图像下项目的属性。我该如何参考 a) 导致弹出窗口打开的对象 b) 数组中对象的属性 - 用于初始视图和更改

我已启用双击图像,如下所示

newImage.doubleClickEnabled=true;
newImage.addEventListener(MouseEvent.DOUBLE_CLICK,createModifyPopUp);

我当前正在调用弹出窗口,如下所示

private function createModifyPopUp(evt:MouseEvent):void{
var mywin1:Modify=PopUpManager.createPopUp(this,Modify,true) as Modify;
PopUpManager.centerPopUp(mywin1);
}

我似乎没有将事件传递到弹出窗口中- 有没有一种方法可以根据原始应用程序中单击的图像来构建和捕获修改中的信息。

I have a situation where I have some images on screen with business properties(value, quantity, qualitygrade) assigned to them. When I click on them, a popUp window needs to open and allow me to change properties for the item under the image. How do I reference
a) object that caused the popup to open
b) properties of the object that are housed in a array- both for initial view and change

I have the images enabled for doubleclick as follows

newImage.doubleClickEnabled=true;
newImage.addEventListener(MouseEvent.DOUBLE_CLICK,createModifyPopUp);

I am currently calling the popUp window as follows

private function createModifyPopUp(evt:MouseEvent):void{
var mywin1:Modify=PopUpManager.createPopUp(this,Modify,true) as Modify;
PopUpManager.centerPopUp(mywin1);
}

I don't seem to be passing an event into the popup- Is there a way I can work based on the image clicked in the original application to build and capture information in the modify.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

空名 2024-11-15 11:32:48

只需使用 PopUpManager.addPopup 而不是 PopUpManager.createPopUp

您的示例应如下所示:

//define properties in the Modify class (Modify.as3 or Modify.mxml)
public var someData: Array;
public var eventTarget: Object;


// listener
private function createModifyPopUp(evt:MouseEvent):void{
   var modify: Modify = new Modify();
   // pass parameters to the instance of Modify class
   modify.someData = arr;
   modify.eventTarget = evt.target;

   // show popup
   PopUpManager.addPopUp(modify, this, true);
   PopUpManager.centerPopUp(modify);
}

simply use PopUpManager.addPopup instead of PopUpManager.createPopUp

your example should look like this:

//define properties in the Modify class (Modify.as3 or Modify.mxml)
public var someData: Array;
public var eventTarget: Object;


// listener
private function createModifyPopUp(evt:MouseEvent):void{
   var modify: Modify = new Modify();
   // pass parameters to the instance of Modify class
   modify.someData = arr;
   modify.eventTarget = evt.target;

   // show popup
   PopUpManager.addPopUp(modify, this, true);
   PopUpManager.centerPopUp(modify);
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文