# Help with script

**URL:** https://forum.kirupa.com/t/help-with-script/166950
**Category:** Uncategorized
**Created:** [October 24, 2005, 9:35am UTC](https://forum.kirupa.com/t/help-with-script/166950 "2005-10-24T09:35:45Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![woopsedoo](https://avatars.discourse-cdn.com/v4/letter/w/a87d85/32.png) [@woopsedoo](https://forum.kirupa.com/u/woopsedoo)
#### Post date: [October 24, 2005, 9:35am UTC](https://forum.kirupa.com/t/help-with-script/166950/1 "2005-10-24T09:35:45Z")

</div>

hi ive got an object and i want to make it change color to black when i press the space key. but i want to do it as an “”=function() {} the code i have is not working can anyone help me please  
heres my code:

onClipEvent (enterFrame) {  
var co = new Color(this);  
Key.SPACE.onKeyDown = function() {  
co.setRGB(0x000000);  
};  
}

any help would be appreciated.  
thanks  
sam
