# MX6- Script trouble, movement easing

**URL:** https://forum.kirupa.com/t/mx6-script-trouble-movement-easing/115991
**Category:** Uncategorized
**Created:** [July 13, 2004, 6:27pm UTC](https://forum.kirupa.com/t/mx6-script-trouble-movement-easing/115991 "2004-07-13T18:27:10Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![codman3000](https://avatars.discourse-cdn.com/v4/letter/c/cdc98d/32.png) [@codman3000](https://forum.kirupa.com/u/codman3000)
#### Post date: [July 13, 2004, 6:27pm UTC](https://forum.kirupa.com/t/mx6-script-trouble-movement-easing/115991/1 "2004-07-13T18:27:10Z")

</div>

Hi,  
I’m sure this is very simple, been searching the boards for ages, but can’t find the right solution. I want to create a simple actionscript rectangle mask which slides down to reveal an image when an swf is opened.

I would use a standard tween but the image is large and I want to have some nice easing going on.

This is what I have to move the rectangle:

onClipEvent (load) {  
this.\_y = 50;  
}  
onClipEvent (enterFrame) {  
if (this.\_y\<300) {  
this.\_y += 5;  
}  
}

I found this script for the easing, but I’m not sure where it goes in the above code:

k = elapsedTime/duration; // k = 0-1  
k = k_k_(3-2\*k); // apply easing  
\_x = start + (target - start)\*k;

I’m hoping its just a case of piecing these two bits of code together.  
Any help would be greatly appreciated, (Flash Mx6)

Cheers!
