Thanks, I added trackAsMenu="true" and the button now works as expected with a single click.
Thank you Andrew --- In [email protected], Abdul Qabiz <[EMAIL PROTECTED]> wrote: > Hi, > > It seems to be a limitation, however I will verify and file the issues.. > > Since both buttons are at same place, when you click one button and don't > move mouse and other button appears at the same place...Other button doesn't > get into over state or doesn't get the focus. So you have to do either of > following: > > - move mouse out of the button area and move mouse back on button then > click. > - Or do double clicking.... First click gives the focus to button and second > click executes the click handler.. > > This is more of Flash Player level issue... > > But as a workaround, you can try adding "trackAsMenu=true" in Button tag, as > shown below. You can find more information about trackAsMenu in Flash docs, > see the url mentioned later in this mail. > > > <?xml version="1.0" encoding="utf-8"?> > <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml"> > <mx:ViewStack id="mainVSK" height="300" width="450"> > <mx:Canvas id="optionsCVS" width="100%" height="100%" > backgroundColor="#EAEAEA" borderStyle="solid"> > <mx:Button label="Show Price Data" x="320" y="270" > click="mainVSK.selectedChild=priceDataCVS" trackAsMenu="true"/> > </mx:Canvas> > <mx:Canvas id="priceDataCVS" width="100%" height="100%" > backgroundColor="#EAEAEA" borderStyle="solid"> > <mx:Button label="Show Options" x="320" y="270" > click="mainVSK.selectedChild=optionsCVS" trackAsMenu="true" /> > </mx:Canvas> > </mx:ViewStack> > </mx:Application> > > > trackAsMenu docs: > http://livedocs.macromedia.com/flash/mx2004/main_7_2/00001562.html > > > > -abdul > > > > > > > > -----Original Message----- > From: greenfishinwater [mailto:[EMAIL PROTECTED] > Sent: Thursday, March 03, 2005 7:10 PM > To: [email protected] > Subject: [flexcoders] Click on button problem > > > > I have a viewstack which contains two canvases, the same size which overlay > each other. Each canvas has a different button which displays the other > canvas, and each button has the same x and y position. > > What I have noticed is that sometimes, when I click on one button, to > display the other canvas, then I don't physically move the mouse, and click > on the other button which is now displayed, it doesn't show the original > canvas, sometimes I have to click twice. But if I move the mouse between > each click, then the first click always shows the other canvas. > > This is an example that illustrates this problem. > > <?xml version="1.0" encoding="utf-8"?> > <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml"> > <mx:ViewStack id="mainVSK" height="300" width="450"> > <mx:Canvas id="optionsCVS" width="100%" height="100%" > backgroundColor="#EAEAEA" borderStyle="solid"> > <mx:Button label="Show Price Data" x="320" y="270" > click="mainVSK.selectedChild=priceDataCVS" /> > </mx:Canvas> > <mx:Canvas id="priceDataCVS" width="100%" height="100%" > backgroundColor="#EAEAEA" borderStyle="solid"> > <mx:Button label="Show Options" x="320" y="270" > click="mainVSK.selectedChild=optionsCVS" /> > </mx:Canvas> > </mx:ViewStack> > </mx:Application> > > Andrew > > > > > > > Yahoo! Groups Links

