开发者

How to make flash builder component affect main application?

开发者 https://www.devze.com 2023-02-09 04:01 出处:网络
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 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 m开发者_JS百科y 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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号