This content has been marked as final. Show 4 replies
See my response in the post titled ViewStack.
One easy way to do this would be to store the Array Result in a public variable in the main application. Here's how to do it in ActionScript:
--- Main Application ----
public var arrayResult:Array;
// The result handler of the Main Application....
private function resultHandler(event:ResultEvent):void
arrayResult = new Array(event.result);
--- ViewStack Child ---
for each (var object:Object in parentApplication.arrayResult)
Eric and Tracy,
Thanks for these suggestions. I will try them. I think the real issue is knowing HOW to call back to the "parentApplication" (whatever that is. ;) I just learned something new, thanks).
I do appreciate the more in-depth how-to's, having come from the procedural world of CF. Like many starting to use Flex, I sort of fell into this field, having no real background or formal programming experience and learning by example is really useful. I mainly did business development before getting into Flex programming.
Like learning to talk in another country that also uses sign language and clicks in the vocabrulary, we have to learn a whole new vocabulary and even way of thinking about what and how we say things. Again, thanks for the patience and time.
Struggling Flex Coders Anonymous Member Since 2007
Yes, it can be messy, because there is more than one way to do most anything. For accessing members in the "ancestor" chain, you can use: parent, parentDocument, parentApplication, and Application.application.
Knowing which to use just takes experience. Here is my summary:
parent: the immediate component parent. eg. TextInput -> parent canvas/
parentDocument: The containing component file. TextInput -> parentCanvas -> Viewstack ....->...>...MyComponent.mxml(or .as)
parentApplication: TextInput -> ......-> [first application tag]. This is NOT always the top-level application, because an app can be loaded in SWFLoader.
Application.application: ALWAYS the top-level application.