# Define hit area

**URL:** <https://forum.kirupa.com/t/define-hit-area/89621>\
**Category:** Uncategorized\
**Created:** [May 10, 2005, 6:13am UTC](https://forum.kirupa.com/t/define-hit-area/89621 "2005-05-10T06:13:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![leiss](https://avatars.discourse-cdn.com/v4/letter/l/4bbf92/32.png) [@leiss](https://forum.kirupa.com/u/leiss)\
**Post date:** [May 10, 2005, 6:13am UTC](https://forum.kirupa.com/t/define-hit-area/89621/1 "2005-05-10T06:13:25Z")

</div>

hei,

how can i achieve the following: see swf-file

the grey rectangle should start fading in when i reach the red square (hit area), not already when you cross the edges of the grey square… this seems to be a easy one - if one knows (sofar about the status of my flash-knowledge!)

the “button” is a movieclip.

see also pdf:  
first layer has the button-coding (see below)  
second + third layer contain the motion-tweened rectangle/square.

thanks for helping :te:

coding in the first layer:

stop();

this.onEnterFrame = function(){  
if(rewind == true){  
prevFrame();  
}  
}

this.onRollOver = function(){  
rewind = false;  
play();  
}

this.onRollOut = function(){  
rewind = true;  
}

this.onRelease = function(){  
\_root.gotoAndPlay(34);  
}
