[flexcoders] Re: accessing nested objects... what am I missing?!?!
Would this work even for sending a variable from a component say called page001.mxml to navigation.mxml? --- In flexcoders@yahoogroups.com, "Gordon Smith" <[EMAIL PROTECTED]> wrote: > > > how can I call master.mxml functions from navigation.mxml > > parentApplication.myFunction() > > Gordon Smith > Adobe Flex SDK Team > > > > From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On > Behalf Of ryanharlin > Sent: Monday, December 03, 2007 12:26 PM > To: flexcoders@yahoogroups.com > Subject: [flexcoders] Re: accessing nested objects... what am I > missing?!?! > > > > 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 <mailto:flexcoders% 40yahoogroups.com> > , "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 > > > It looks like this: > > > > > > > > > > > > > > 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: > > > > > 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. > > >
[flexcoders] Re: accessing nested objects... what am I missing?!?!
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 tags so it looks like this: 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" 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" 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 > > > > > It looks like this: > > > > > > > > > > > > > > > > > > > > > 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: > > > > > > > > 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. > > > > > >
RE: [flexcoders] Re: accessing nested objects... what am I missing?!?!
> how can I call master.mxml functions from navigation.mxml parentApplication.myFunction() Gordon Smith Adobe Flex SDK Team From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ryanharlin Sent: Monday, December 03, 2007 12:26 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: accessing nested objects... what am I missing?!?! 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 <mailto:flexcoders%40yahoogroups.com> , "ryanharlin" <[EMAIL PROTECTED]> 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 > It looks like this: > > > > > > > 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: > > 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. >
[flexcoders] Re: accessing nested objects... what am I missing?!?!
It is better to dispatch events from your nested component and handle them in your parent component. --- In flexcoders@yahoogroups.com, "ryanharlin" <[EMAIL PROTECTED]> 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" 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 > > > It looks like this: > > > > > > > > > > > > > > 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: > > > > > 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. > > >
[flexcoders] Re: accessing nested objects... what am I missing?!?!
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" <[EMAIL PROTECTED]> 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 > It looks like this: > > > > > > > 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: > > 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. >