Gordon,
This is EXACTLY what I was looking for to get the button to link to the other child page. Thank you soooo much for posting that.

Doug,
I see what you are saying, but I'm so new to Flex and I didn't come over from Flash Dev. so I'm really not that hip on ActionScript. If someone could provide a little more assistance, that would be so awesome.

Here is what I've gotten so far (and I'm not sure if any of it is correct):

On JobSearch.mxml I set this up:

[Bindable]
public var job_id:Number = currentJob.job_id
(I'm hoping that'll assign the job_id variable the job_id of the current selected job)

On Timeline3.mxml I set this up:

[Bindable]
public var job_id:Number

I am not sure how to use the DataBinding to hook up the two.

Thank you in advance for further assistance to us ignorant newb Flex Coder posers. :-)

April



On Mar 15, 2007, at 4:00 PM, Gordon Smith wrote:


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: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Doug McCune
Sent: Thursday, March 15, 2007 12:03 PM
To: flexcoders@yahoogroups.com
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] > 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: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of April Rosequist
Sent: Thursday, March 15, 2007 1:12 PM
To: flexcoders@yahoogroups.com
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








Reply via email to