# Remove a gate with a button?

**URL:** <https://forum.kirupa.com/t/remove-a-gate-with-a-button/228130>\
**Category:** flash\
**Created:** [June 5, 2007, 4:18pm UTC](https://forum.kirupa.com/t/remove-a-gate-with-a-button/228130 "2007-06-05T16:18:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![J\_M](https://avatars.discourse-cdn.com/v4/letter/j/e99b99/32.png) [@J\_M](https://forum.kirupa.com/u/J_M)\
**Post date:** [June 5, 2007, 4:18pm UTC](https://forum.kirupa.com/t/remove-a-gate-with-a-button/228130/1 "2007-06-05T16:18:28Z")

</div>

I can’t figure out how to make a movie clip move out of the way when your keyboard controled character is over another movie clip.

Here is the code i tried:  
if ((\_root.button.hitTest(\_x, \_y+radius, true)) or (\_root.button.hitTest(\_x, \_y-radius, true)) or (\_root.button.hitTest(\_x+radius, \_y, true)) or (\_root.button.hitTest(\_x-radius, \_y, true))) {  
gate2.\_y -= 3  
}  
button and gate2 are my instance names.
