如何让flash builder组件影响主应用程序?
我有我的主应用程序,其中包含一个组件的多个实例,这些实例创建属于特定类别的照片网格。 (网格和照片是通过循环动态创建的)。
我希望能够单击照片来运行一个功能,将照片的大版本加载到主应用程序中包含的单独元素中。因此,我在主应用程序中创建了一个照片组件,但是如何使用actionscript 从tileview 组件内部更改主应用程序中的“currentphoto”变量?
或者,我可以将该函数放在主应用程序中(从长远来看可能更合乎逻辑),但是我如何从子组件中调用它?
I have my main application, which contains several instances of a component that create a grid of photos belonging to a certain category. (the grids, and the photos are created dynamically with a loop).
I'd like to be able to click a photo to run a function that loads the large version of the photo into a separate element that is contained in the main application. So I created a Photo component in my main application, but how, using actionscript, do I change the 'currentphoto' variable in my main application from inside the tileview component?
Alternately I could put the function in the main application (probably more logical in the long run), but how would I call it from the child component?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当选择主应用程序为其添加事件侦听器的照片时,我会在平铺视图中调度 Event.SELECT 事件。 tileview 应该有一个 selectedImage 属性或类似的属性,以便主应用程序可以确定在收到事件时在照片组件中加载什么图像。
I would dispatch a Event.SELECT event in the tileview when a photo is selected that the main application adds an event listener for. The tileview should have a selectedImage property or something similar so that the main app can determine what image to load in the photo component when it receives an event.