Try:

if(productTree.selectedItem.label == "Folder 1")

 

Do you see why?

 

Tracy

 


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of s_hernandez01
Sent: Thursday, September 28, 2006 5:48 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Tree Help Please

 

Would anyone know how to write actionscript telling Flex to call up an
index in a ViewStack using a tree whose folders are coded in xml?
Here is something of what I want the code to say, but I can't get
passed the errors.

For example:
if(productTree.selectedItem == "Folder 1"){
viewstack.selectedIndex=0;
}
else if(productTree.selectedItem == "Folder 2"){
viewstack.selectedIndex=1;
}

Below is how my tree is coded:

<mx:Tree id="productTree" labelField = "@label" width="100%"
fontSize="10" fontWeight="bold" showRoot="false"
height="100%">
<mx:dataProvider>
<mx:XML format="e4x" xmlns="">
<root>
<folder label = "Folder 1" isBranch = "true">
<folder label = "item 1"/>
<folder label = "item2"/>
</folder>
<folder label = "Folder 2" isBranch = "true">
<folder label = "item 1"/>
<folder label = "itme 2"/>
</folder>
</mx:XML>
</mx:dataProvider>
</mx:Tree>

__._,_.___

--
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