# Button component swapping problem

**URL:** <https://forum.kirupa.com/t/button-component-swapping-problem/85949>\
**Category:** flash\
**Created:** [April 8, 2005, 3:56pm UTC](https://forum.kirupa.com/t/button-component-swapping-problem/85949 "2005-04-08T15:56:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![clinch](https://avatars.discourse-cdn.com/v4/letter/c/958977/32.png) [@clinch](https://forum.kirupa.com/u/clinch)\
**Post date:** [April 8, 2005, 3:56pm UTC](https://forum.kirupa.com/t/button-component-swapping-problem/85949/1 "2005-04-08T15:56:20Z")

</div>

hello. I’m wondering if anyone has any advice on this problem I’m experiencing:

I have two instances of Button components in my application and I’m swapping the buttons on the fly by using

```auto
buttonInstanceName1._visible = true;
buttonInstanceName2._visible = false;

```

Since the Buttons are in the exact same location, and they are of the same size, this swaps the two buttons and their functionality. However, I’m experiencing a problem where if I keep my mouse perfectly still while the swap takes place, then buttonINstanceName2 doesn’t receive the event that a mouse is hovered over it. If I click the mouse button once, then the “over” state is triggered, and it takes two clicks to actually call the Button click event. If I mouse my mouse by one pixel before clicking, then the “over” state is triggered and I can proceed as expected. It’s only when the mouse remains perfectly still.

To make the situation even more strange, this only seems to be happening on one swap. If I swap back to the original, then the button correctly receives my click on the first try.

Any ideas on how to fix this, or a hack that might make it work the way I need?
