Spark TitleWindow - 将数据返回到主应用程序
我创建了一个 Spark TitleWindow(使用 mxml 组件),在其中我选择了一些内容并希望它返回到主应用程序变量。 例如,在主应用程序中,我有一个变量名称 currMaxPlayers:int ,在 TitleWindows 中,我创建了一个表单,您可以选择玩家数量,当选择数量然后按提交按钮时,我希望所选的数量回到 MainApplication 中的 currMaxPlayers 变量。 我已按照此处的说明进行操作 http://help.adobe.com/en_US/flex/using/WS6c678f7b363d5da52e8f1ca1124a0430dcf-8000.html 没有成功。
谢谢
I have created a spark titlewindow (using mxml component) which there I select some stuff and want it to get back to the Main application variables.
For example, in the main application I have a var name currMaxPlayers:int and in the TitleWindows I have created a form which you can choose number of players, when selecting the number and then pressing submit button, I want the number that was selected to get back into the currMaxPlayers var in the MainApplication.
I have followed the instructions here http://help.adobe.com/en_US/flex/using/WS6c678f7b363d5da52e8f1ca1124a0430dcf-8000.html with no success.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
假设您使用 PopUpManager 打开自定义 TitleWindow,PopUpManager 应调度一个带有玩家数量值的自定义事件,并且打开 TitleWindow 的组件可以侦听该事件。在不编写正式测试的情况下,编写如下代码:
您的自定义事件类:
在标题窗口中,分派该事件:
并返回到创建标题窗口的模板:
Assuming that you are opening your custom TitleWindow with the PopUpManager, the PopUpManager should dispatch a custom event with the number of players value and the component which opens the TitleWindow can listen for that event. Without writing formal tested, code something like this:
Your custom event class:
In the Title Window, dispatch that event:
And back to the template which creates the title window: