Hi, Button shouldn't loose focus after being clicked. But I remember, someone had similar problem with buttons inside Canvas/ViewStack.
Can you post your code here? For a quick workaround, I guess adding trackAsMenu="true" in your Button component would work. <mx:Button trackAsMenu="true"/> I am attaching that thread, it might help you... -abdul -----Original Message----- From: Harris Reynolds [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 06, 2005 10:18 AM To: [email protected] Subject: [flexcoders] Problem with Button Losing Focus I am experiencing a fairly strange problem with a button component losing focus after it is clicked and before the mouse is moved. I have a wizard-like application (Previous and Next navigation through a ViewStack), and a user must click the previous button twice if iterating backward through the application: 1) to give the button focus and 2) to fire the click event. Essentially the button loses focus after a click and only regains focus if the button is clicked again OR the mouse is moved. Has anyone seen this kind of behaviour? thanks, ~harris __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com Yahoo! Groups Links Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
From: Abdul Qabiz Sent: Thursday, March 03, 2005 7:31 PM To: '[email protected]' Subject: RE: [flexcoders] Click on button problem 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

