You could also allow binding to take care of everything for you, if you are trying to have the list display the titles of your panels in the ViewStack.

Something like
<mx:List x="0" y="0" width="10%" height="10%" id="myList" dataProvider="{ panelVS.getChildren()}" labelField="title" >
</mx:List>

<mx:ViewStack id="panelVS" width="50%" height="50%" selectedIndex="{myList.selectedIndex}">
<mx:Panel width="100%" height="100%" id="panelOne" title="Panel One"/>
<mx:Panel width="100%" height="100%" id="panelTwo" title="Panel Two"/>
</mx:ViewStack>

Hope this helps,
   Scotty Scott
   http://www.franciswscott.com


On 7/20/06, s_hernandez01 <[EMAIL PROTECTED]> wrote:

Hey Flexers

I am trying to use the ViewStack to switch Panels from a List
Component, but I am having no luck because I get an error saying "Call
to possibly undefined method ItemClickEvent". Could someone help me,
please?

<mx:Canvas x="0" y="0" width="100%" height="100%">
<mx:HBox x="0" y="0" width="100%" height="100%"
horizontalAlign="center" verticalAlign="middle">

<mx:List x="0" y="0" width="10%" height="10%" id="myList"
itemClick="panelVS.selectedIndex=ItemClickEvent(event).index">
<mx:dataProvider>
<mx:Array>
<mx:Object label = "Panel 1"/>
<mx:Object label = "Panel 2"/>
</mx:Array>
</mx:dataProvider>
</mx:List>

<mx:ViewStack id="panelVS" width="50%" height="50%">
<mx:Panel width="100%" height="100%" id="panelOne" title="Panel One"/>
<mx:Panel width="100%" height="100%" id="panelTwo" title="Panel Two"/>
</mx:ViewStack>

</mx:HBox>
</mx:Canvas>

Thanks

Sal


__._,_.___

--
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
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to