You can certainly do what you ask.

 

Is “targetComponent” a valid reference?

Are you passing in a reference to “this” when you instantiate the child components?

<ViewStack …

  <myComponent targetComponent=”{this}”

 

You could also just do:

Application.application.mainStack.selectedIndex = 1;

 

But then you can only use the child component in a viewstack in the main app scope.  The first wayt lets you have a different component parent.

 

Another way, preferred by many, is to have your component emit a custom event, and have a listener respond to it.

 

Tracy


From: [email protected] [mailto:[email protected]] On Behalf Of christophevond
Sent: Monday, September 25, 2006 12:40 PM
To: [email protected]
Subject: [flexcoders] Veiwstack reference

 

I have an application that has a viewstack on the first page and in
the children of this viewstack, I would like to have a button that
changes the shown child of the viewstack.

This is what I was trying before, but it doesn't want to work:

[Bindable]
public var targetComponent:index; (Where index is the first page)

public function ChangeStack():void {
targetComponent.mainStack.selectedIndex = 1;
}

mainStack is the ID of the viewstack on the first page.

Thanks.

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to