# Hittest

**URL:** <https://forum.kirupa.com/t/hittest/170465>\
**Category:** Uncategorized\
**Created:** [November 26, 2005, 12:28pm UTC](https://forum.kirupa.com/t/hittest/170465 "2005-11-26T12:28:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![vectorboy](https://avatars.discourse-cdn.com/v4/letter/v/7ea924/32.png) [@vectorboy](https://forum.kirupa.com/u/vectorboy)\
**Post date:** [November 26, 2005, 12:28pm UTC](https://forum.kirupa.com/t/hittest/170465/1 "2005-11-26T12:28:04Z")

</div>

Hi everybody!  
(Hi, dr. Nick!),

I have a little question for you all. I’m using AS to let the user use his arrow keys (up & down). My code is working but I want a system that if the MC with the text in it hits something, it will stop moving so that the text cannot go “outside” the .fla…

[font=Courier New][size=2][color=#000080]if[/color] ([color=#000080]this[/color], [color=#000080]hitTest/color) {  
[color=#0000ff] this.\_x = -1000;[/color]  
} [color=#000080]else[/color] {  
[color=#0000ff] [/color] [color=#008000]this.\_x = location+i++;[/color]  
}

This code comes from a tutorial from [kirupa.com](http://kirupa.com) and I think I’ll need something like that.

Thx!  
vectorboy.be  
[/size][/font]
