# onRelease onRelease!

**URL:** <https://forum.kirupa.com/t/onrelease-onrelease/179689>\
**Category:** Uncategorized\
**Created:** [February 22, 2006, 10:05am UTC](https://forum.kirupa.com/t/onrelease-onrelease/179689 "2006-02-22T10:05:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Claire\_murphy](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@Claire\_murphy](https://forum.kirupa.com/u/Claire_murphy)\
**Post date:** [February 22, 2006, 10:05am UTC](https://forum.kirupa.com/t/onrelease-onrelease/179689/1 "2006-02-22T10:05:39Z")

</div>

Hiya peeps.

I finaly got the code I needed to change the colour of my background but it clearly needs altering. At the moment it works but I have to click the button twice for the colour to change. Now for once I see that this makes sense because I have onRelease twice!

This code is on the button:

on (release) {  
home\_btn.onRelease = function() {  
var myColor:Color = new Color (this.\_root.background1);  
myColor.setRGB(0xFF8844);}

However i’m unsure how to alter the code correctly…I assume the second onRelease needs to change to something else? I tried just:  
home\_btn = function() { but am really just guessing.

Anyone that could give me a heads up on this would be very much appreciated.  
Thanks
