# \[fmx2004\]Function Coolio

**URL:** <https://forum.kirupa.com/t/fmx2004-function-coolio/100301>\
**Category:** Uncategorized\
**Created:** [January 27, 2004, 11:17pm UTC](https://forum.kirupa.com/t/fmx2004-function-coolio/100301 "2004-01-27T23:17:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![InsaneMonk](https://avatars.discourse-cdn.com/v4/letter/i/ce7236/32.png) [@InsaneMonk](https://forum.kirupa.com/u/InsaneMonk)\
**Post date:** [January 27, 2004, 11:17pm UTC](https://forum.kirupa.com/t/fmx2004-function-coolio/100301/1 "2004-01-27T23:17:21Z")

</div>

I found a great way to make simple movement. (You can add other arguments if you’d like):  
in teh frame:  
[AS]function movement(object, key, xspeed, yspeed) {  
if (Key.isDown(key)) {  
object.\_x += xspeed;  
object.\_y += yspeed;  
}  
}  
[/AS]  
in teh movie clip:  
[AS]//move right  
movement(this, Key.RIGHT, 5, 0);  
[/AS]  
u can move in any direction by changeing the key and x & y speeds! 🙂
