[ https://issues.apache.org/jira/browse/FLEX-28428?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Justin Mclean updated FLEX-28428: --------------------------------- Labels: easytest (was: ) > Button removed with removeChild() reappears in over state when readded > ---------------------------------------------------------------------- > > Key: FLEX-28428 > URL: https://issues.apache.org/jira/browse/FLEX-28428 > Project: Apache Flex > Issue Type: Bug > Components: .Unspecified - Framework > Affects Versions: Adobe Flex SDK 4.5.1 (Release) > Environment: Affected OS(s): Windows > Affected OS(s): Windows 7 > Browser: Other (specify version) > Language Found: English > Reporter: Adobe JIRA > Labels: easytest > > Steps to reproduce: > 1. Add a SimpleButton to the stage > 2. In the click listener for the button, remove the button using removeChild() > 3. Re-add the button using addChild() > > Actual Results: > The button is re-added in the over state, not the up state > > > Expected Results: > The button is re-added or the up state, or reset to the up state > > > Workaround (if any): > None. > I've added a project file to test, with two classes (swf included): > MyButton.as (just there to create a button) and Main.as (shows the bug). > There are 2 buttons on the stage; one set to removeChild() when you click on > it, and one set to visible = false when you click on it. Press space to bring > both buttons back. The button set to removeChild() will come back in it's > over state, while the visible = false button will come back properly, in it's > up state. > If you remove the button with visible = false, then the bug isn't present, > it's only with removeChild(). I thought it might be because the mouse out > listener wasn't getting called, but in looking at the listeners, it's getting > called fine (it might be that in mouse_out, where you'd normally reset to the > up state, there's a check or something to see if the stage exists). > Possibly related: when clicking on the button and removing it with > removeChild(), the focus isn't reset (i.e. you have to click on the stage if > you want any keyboard events to fire), whereas with visible = false, it is. > Setting stage.focus = null, or stage.focus = stage; doesn't resolve the > problem though. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira