If the Button is in JobSearch.mxml, then "walking the DOM up" would mean
calling
parentDocument.preTrafficNav.selectedIndex = 1;
because the parentDocument of JobSearch is the app (or component)
containing it, which also contains the ViewStack preTrafficNav.
- Gordon
________________________________
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Doug McCune
Sent: Thursday, March 15, 2007 12:03 PM
To: [email protected]
Subject: Re: [flexcoders]
I'll agree that an event dispatching method is sort of the "correct" way
to go. But if you want a quick way that will work, you could have a
bindable public variable named job_id in both your JobSearch and
Timeline3 components and then use data binding to bind the job_id in
Timeline3 to the job_id in JobSearch. So that way whenever it's updated
in JobSearch it will get updated in Timeline3.
Doug
On 15 Mar 2007 11:44:59 -0700, Karl Johnson
<[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> > wrote:
There are a lot of ways to accomplish this, but the best
practice would be to fire off an event in JobSearch and have either Main
listen on it and call a fuction in timeline3 or use a central event
dispatcher and have timeline three listen for it directly.
But you could also use
application.Application.timeline3.methodName or walk the DOM up, but
neither are really advised.
Karl
Cynergy
From: [email protected]
[mailto:[email protected] <http://yahoogroups.com> ] On Behalf
Of April Rosequist
Sent: Thursday, March 15, 2007 1:12 PM
To: [email protected]
Subject: [flexcoders]
I've been looking all day and can't find a solution to this -
although I'm sure it's very simple.
I have a main application that I'm using a ViewStack in:
<mx:ViewStack id="preTrafficNav" width="100%" height="100%"
creationPolicy="all" x="10" y="90">
<v:JobSearch id="jobsearch" width="100%" height="100%"/>
<v:Timeline3 id="timeline3" width="98%" height="711"/>
</mx:ViewStack>
This works great. :-)
The JobSearch.mxml page has a button that when you click on it,
I
want to take the job_id variable I've declared and pass it to
the
Timeline3 page and have that page as the main page.
If I put the button on the main.mxml page, everything works fine
(except for passing the variable, but it will at least change
the
page)... but if I put the button on the JobSearch.mxml page it
doesn't work. I guess I don't know the syntax for doing that.
If someone would help me with the syntax to link from one child
to
another, when the children are their own mxml pages I would be
soooo
appreciative.
Thanks!
April