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.
精彩评论