Use the change event of the ViewStack and
then test the event.newValue for a page number. The sample below toggles between two
panels incrementing a label each time. <?xml version="1.0"
encoding="utf-8"?> <mx:Application
xmlns:mx="http://www.macromedia.com/2003/mxml"> <mx:ViewStack
id="myStack" change="incrementCount(event)" > <mx:Panel
label="first" >
<mx:Label text="Label1" mouseUp="myStack.selectedIndex=1;myStack.invalidate"/> </mx:Panel> <mx:Panel
label="second" >
<mx:Label id="lblCount" text="0"
mouseUp="myStack.selectedIndex=0;myStack.invalidate"/> </mx:Panel> </mx:ViewStack> <mx:Script> <![CDATA[ function incrementCount(event) { if (event.newValue==1)
lblCount.text = 1 + Number(lblCount.text); } ]]> </mx:Script> </mx:Application> From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Hi , |