Lets say I have a Flex Component called test1.mxml and that component has a view stack. I then create another component called test2.mxml and I want to reference the view stack in test1.mxml, can I do that?
The problem is I want to change states so I have a component that is register.mxml and another one that says login.mxml. So here I have a veiwStack on the main application for <Application xmlns:log="com.login.*" mxlns:reg="com.register.*"> <mx:ViewStack id="vsApp" width="100%" height="100%"> <mx:Canvas label="vsScreenLogin" id="vsScreenLogin"> <log:Login x="302" y="138"/> </mx:Canvas> <mx:Canvas label="vsRegister" id="vsRegister"> <reg:Register/> </mx:Canvas> </mx:ViewStack> </Application> OK, so in the login.mxml I have a button that says register and when that is clicked I want to run this to change the state: vsApp.selectedChild=vsScreenLogin. I am unable to run this command from Login.mxml because login.mxml dosnt know about the main app. How can I pass information from a Flex component to the main application???? Thanks for the help, timgerr --- In flexcoders@yahoogroups.com, "Gordon Smith" <[EMAIL PROTECTED]> wrote: > > If you have > > > > <Application> > > <MyContainer id="myContainer"> > > <MyControl id="myControl"/> > > </myContainer> > > </Application> > > > > then in the Application's <Script> you can simply refer to the > MyContainer instance as myContainer and to the MyControl instance as > myControl (NOT myContainer.myControl). > > > > In MyContainer's <Script> you can refer to the Application instance as > parentDocument or as Application.application. > > > > In MyControls' <Script> you can refer to to the MyContainer instance as > parentDocument and to the Application instance as > parentDocument.parentDocument or as Application.application. > > > > In general, you can access anything from anywhere. > > > > Gordon Smith > > Adobe Flex SDK Team > > > > ________________________________ > > From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On > Behalf Of timgerr > Sent: Tuesday, April 15, 2008 8:20 PM > To: flexcoders@yahoogroups.com > Subject: [flexcoders] Flex Compenents, how to make them talk > > > > I was wondering if I create a Flex Application and have 5 Flex > components that integrate within my Flex App, how can they all talk to > each other???? Since they do not know about each other till the swf > file is compiled, I am unable to have one component event trigger > something on another component because they dont know about each other. > > Thanks for the help, > > Timgerr >