Thanks Tracy…that’s explains it…the syntax and methods internal to this script is starting to gel, but not optimally yet…hopefully soon J

 


From: Tracy Spratt [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 10, 2005 11:52 AM
To: [EMAIL PROTECTED]
Subject: RE: [flexcoders] ViewStack selectedChild

 

Just jumping in here, but selectedChild is/wants a reference to the actual container component in the view stack.  So unless you have a reference to the container in the data property of the item, this won’t work.

 

What Matt is saying is that if the data property contains the “id” for the viewstack component, then you can usethe bracket notation to get a reference to the actual object.

 

this[“myComponentId”] is saying “return the property of this(the application or component) that is named “myComponentId””.

 

It is esentially the same as saying eval(“myComponentId”)

 

So selectedChild = this[“myComponentId”] is getting a ref to the real child component.

 

Tracy

 


From: Rob [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 10, 2005 9:34 AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] ViewStack selectedChild

 

Hi Matt,

 

Thanks for the reply…what you coded is (I think) exactly what I did, but doesn’t work.  An example of what I have is:

 

function x(event:Object):Void
{

            viewStack.selectedChild=event.target.selectedItem.data;

}

 

The function is called on a list change event, and the dataProvider for the list has the data property set to the id of a container in the viewstack. 

 

TIA for any info.

 


From: Matt Chotin [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 10, 2005 2:16 AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] ViewStack selectedChild

 

The selectedChild is a reference to the actual object that you would find at the selectedIndex.  So what is the data that you have that will help you determine which object you want to select?  If each element of the dataProvider is the id of the child (this means that every child of your ViewStack has an id), you could simply do myViewStack.selectedChild = this[data].

 

Not sure what you’re trying to really do here.

 


From: Rob [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 09, 2005 2:15 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] ViewStack selectedChild

 

Ok, I’ve been coding too long today…I need to take a data attribute from a dataProvider and cast into an Object that can be used in the statement ViewStack.selectedChild=object…I know this is easy but am having some brain-pain at the moment…TIA for any info.

 

Regards.

 


From: Rob [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 09, 2005 4:40 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] ViewStack selectedChild

 

Oops…it appears I have to use the data attribute to create a new object and use that…nevermind J

 

 


From: Rob [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 09, 2005 4:32 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] ViewStack selectedChild

 

Hi,

 

Just curious…the MM docs indicate that setting of the ViewStack.selectedChild can only be done in AS and not in MXML; however, it appears from the MM example and my tests that the reverse is true…

 

I have a script that is attempting to set the selectedChild to a value that matches the id attribute of one of the ViewStack’s but it doesn’t work….the ViewStack.selectedIndex works great...what’s up with the selectedChild?

 

viewStack.selectedChild=event.target.selectedItem.attributes.data;

 

TIA for any info.

 

Regards.

 

 

 

 

 



Reply via email to