# Flash as2 RPG Game Help! Location of MC When Enemy is killed

**URL:** <https://forum.kirupa.com/t/flash-as2-rpg-game-help-location-of-mc-when-enemy-is-killed/330246>\
**Category:** flash\
**Created:** [December 18, 2012, 9:26pm UTC](https://forum.kirupa.com/t/flash-as2-rpg-game-help-location-of-mc-when-enemy-is-killed/330246 "2012-12-18T21:26:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jason\_Scholz](https://avatars.discourse-cdn.com/v4/letter/j/53a042/32.png) [@Jason\_Scholz](https://forum.kirupa.com/u/Jason_Scholz)\
**Post date:** [December 18, 2012, 9:26pm UTC](https://forum.kirupa.com/t/flash-as2-rpg-game-help-location-of-mc-when-enemy-is-killed/330246/1 "2012-12-18T21:26:09Z")

</div>

Below is my code. It works with no errors, but the outcome is not what I wanted. When the enemy is killed, a gold coin will drop. However, my gold coin is being pinned to the main stage in upper left corner. Even when I tell it NOT to. I want the MC “coin” to appear where the enemy died, NOT in the upper left corner of the stage. I tried codeing specific x, y cordinates for the coin, and still nothing! Please help a young flash game developer 🙂 Thanks!

onClipEvent (mouseDown)  
{  
if (this.hitTest(\_root.\_xmouse, \_root.\_ymouse))  
{  
\_root.eHealth -= random (7) +1;  
\_root.hp -= random (5) + 1;  
}  
if(\_root.eHealth \<= 0)  
{  
this.unloadMovie();  
\_root.attachMovie(“money”,“gold”,200);  
gold.\_x = 200;  
gold.\_y = 250;  
}  
}
