2005/03/30 | flex页面间传参数及与parent window的交互(1)
类别(企业信息化) | 评论(0) | 阅读(1532) | 发表于 10:30
这几天同海波一起研究Flex收获甚丰。
尽管flex并不难但由于无前人经验(项目组)和绝大部分为英文文档,有时候经常是有点小问题都得共同研究很长时间。
所以有点进步经常窃喜。

1、向弹出窗口传参数
使用函数createPopUp(parent:MovieClip, class:Object [, modal:Boolean, initobj:Object, outsideEvents:Boolean]) : MovieClip
flex参考参数说明如下
parent Specifies a reference to a window to popup over.
class Specifies a reference to the class of object you want to create.
modal Specifies an optional Boolean value indicating whether the window is modal (true) or not (false). The default value is false. This argument is optional.
initobj Specifies an optional object containing initialization properties. This argument is optional.
outsideEvents Specifies an optional Boolean value indicating whether an event is triggered if the user clicks outside the window (true) or not (false). The default value is false. This argument is optional.

例mx.managers.PopUpManager.createPopUp(this, addUser,true,{x:225, y:30,parentlabel:this.label1});
这里addUser为要弹出的窗口名。parentlabel为所传的参数,可以是常量,可以是变量,对象,也可以是组件,更可以是一个数组。借此可以通过在弹出的窗口里声明var parentlabel 即可如同本页面样来操作,同时操作的结果会影响到父页面。这里如同javascript里边的模态窗口传参数也可传对象同时还可以影响到parent页面。其他的就不用说明。
要控制parent页面除了上面说的外,注意使用parentApplication和parentDocuemnt。当了解到这两个属性时,你就会发现原来页面之间的距离是这么的近啊!!!1
0

评论Comments