So things are half-working. I say half-working because they work but they give me an error when I compile.
switching a viewstack in the nested mxml app is done like this in my code: viewstack in main file is called "mainscreens" inside that viewstack are two <fr> tags so it looks like this: <mx:ViewStack id=mainScreens > <fr:appOne id="appOne" /> <fr:appTwo id="appTwo" /> </mx:ViewStack> If I try and change a viewstack that's in appOne, called 'myView', I do this (based on advice earlier in this thread): click = "mainScreens.myView.selectedChild = screen2;" If try to run this app I get an error that says: "1119:Access of possibly undefined property myView through a reference with static type mx.containers:ViewStack" BUT IT WORKS! If I ignore the error and run the app, the code works. ???? But I get the error every time I compile and I think it's messing up other things below it in the program. --- In flexcoders@yahoogroups.com, "Adnan Doric" <[EMAIL PROTECTED]> wrote: > > It is better to dispatch events from your nested component and handle > them in your parent component. > > > --- In flexcoders@yahoogroups.com, "ryanharlin" <ryanharlin@> wrote: > > > > Thanks for the help. Your solution worked in practice but I do still > > get an error prior to compiling. If I ignore the error and compile, > > though, it works. > > > > But similarly, I want to be able to call functions that are in these > > different mxml files. So if I have an mxml file called > > navigation.mxml embedded in the master app file called master.mxml, > > how can I call master.mxml functions from navigation.mxml? > > > > Back from the flash days, I thought this would work: > > > > root.myFunction(); > > > > but it doesn't. I'm sure this problem is related to my earlier post, > > that's why I have it in the same thread. > > > > thanks, > > > > ryan > > > > > > > > > > --- In flexcoders@yahoogroups.com, "ryanharlin" <ryanharlin@> wrote: > > > > > > I have a simple enough question, I think. But I've been struggling > > > with it for two days. > > > > > > I have an mxml application which has a viewstack in it. The children > > > in the viewstack are <fr: tags for other mxml files > > > > > > It looks like this: > > > > > > <mx:ViewStack id="mainScreens"> > > > <fr:interfacePanel id="interfacePanel" /> > > > <fr:otherPanel id="otherPanel" /> > > > </mx:ViewStack> > > > > > > In the mxml file called interfacePanel I have another viewstack with > > > interface screens on them. > > > > > > How can I select different children of that viewstack from the main > > > mxml app. > > > > > > I would think I'd do something like this: > > > > > > <mx:button > > > click="mainScreens.interfacePanel.secondViewstack.selectedChild = > > > Page2;" /> > > > > > > But that doesn't work. > > > > > > Does anyone know the method of addressing object across multiple > > > nested mxml files? > > > > > > Thanks! Hopefully someone can show me what I'm missing. > > > > > >