# Move Upwards 10 Pixels When Hit

**URL:** https://forum.kirupa.com/t/move-upwards-10-pixels-when-hit/38310
**Category:** flash
**Created:** [December 21, 2003, 2:28am UTC](https://forum.kirupa.com/t/move-upwards-10-pixels-when-hit/38310 "2003-12-21T02:28:42Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![zeka](https://avatars.discourse-cdn.com/v4/letter/z/c6cbf5/32.png) [@zeka](https://forum.kirupa.com/u/zeka)
#### Post date: [December 21, 2003, 2:28am UTC](https://forum.kirupa.com/t/move-upwards-10-pixels-when-hit/38310/1 "2003-12-21T02:28:42Z")

</div>

Ive got an object called “heart” and I have another object called “k”. The heart follows the mouse and when the heart hits the k I want the k to move upwards by 10 pixels. Can anyone give me the AS on how to do this?

Thx & cheers :sen:

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [December 21, 2003, 2:50am UTC](https://forum.kirupa.com/t/move-upwards-10-pixels-when-hit/38310/2 "2003-12-21T02:50:25Z")

</div>

```auto

heart.onMouseMove = function(){
if(this.hitTest(k)){
k._y +=10;
}
}

```
