# How to extend this?

**URL:** <https://forum.kirupa.com/t/how-to-extend-this/172633>\
**Category:** flash\
**Created:** [December 16, 2005, 10:32am UTC](https://forum.kirupa.com/t/how-to-extend-this/172633 "2005-12-16T10:32:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bennymartensson](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/bennymartensson/32/1317_2.png) [@bennymartensson](https://forum.kirupa.com/u/bennymartensson)\
**Post date:** [December 16, 2005, 10:32am UTC](https://forum.kirupa.com/t/how-to-extend-this/172633/1 "2005-12-16T10:32:12Z")

</div>

Need to make each button in this script have its own unique color? Anyone want to help me to achieve this?

[Download .fla here](http://www.gregory.se/filer1/example.fla)

The code;

```auto
import mx.transitions.Tween; 
import mx.transitions.easing.*;
#include "lmc_tween.as"

function hitButton(btn) {
	btn.onRollOver = function() {
		this.colorTo (0x3366FF); }
	btn.onRollOut = function() {
		this.colorTo (0x000000); }	
	btn.onRelease = function() {
      for (var i = 0; i<5; i++) { 
         _root["btn"+i].enabled = true;
      } 
      flop(myPrevButton);
      if (this._xscale>-50) { 
         this.enabled = false; 
         flip(this);
         myPrevButton = this;
      } 
   } 
}

for (var i = 0; i<5; i++) { 
   _root.hitButton(_root["btn"+i]); 
}

function flip(who) {
	for (var i = 0; i<5; i++) { 
         who.colorTo (0x3366FF, 2); }
   var twflip:Tween = new Tween(who, "_xscale", Bounce.easeOut, 100, -100, 1, true); 
}

function flop(who) {
	for (var i = 0; i<5; i++) { 
         who.colorTo (0x000000, 2); }
   var twflop:Tween = new Tween(who, "_xscale", Bounce.easeOut, -100, 100, 2, true);
}

```
