# There must be a faster way...?

**URL:** <https://forum.kirupa.com/t/there-must-be-a-faster-way/215619>\
**Category:** Uncategorized\
**Created:** [February 8, 2007, 7:23pm UTC](https://forum.kirupa.com/t/there-must-be-a-faster-way/215619 "2007-02-08T19:23:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![calverphoto](https://avatars.discourse-cdn.com/v4/letter/c/ccd318/32.png) [@calverphoto](https://forum.kirupa.com/u/calverphoto)\
**Post date:** [February 8, 2007, 7:23pm UTC](https://forum.kirupa.com/t/there-must-be-a-faster-way/215619/1 "2007-02-08T19:23:42Z")

</div>

Hi,

This codes works for what I need, but I’m sure there would be a more efficent way to write it using an array, but I’m not having much luck. Any ideas?

```auto

#include "lmc_tween.as"
stop();

s1.onRelease = function() {
	s1.colorTo(0x0099FF, 0.5, easeoutSine);
	s2.colorTo(0x000000, 0.5, easeoutSine);
	s3.colorTo(0x000000, 0.5, easeoutSine);
	s4.colorTo(0x000000, 0.5, easeoutSine);
	s5.colorTo(0x000000, 0.5, easeoutSine);
}
s2.onRelease = function() {
	s1.colorTo(0x000000, 0.5, easeoutSine);
	s2.colorTo(0x0099FF, 0.5, easeoutSine);
	s3.colorTo(0x000000, 0.5, easeoutSine);
	s4.colorTo(0x000000, 0.5, easeoutSine);
	s5.colorTo(0x000000, 0.5, easeoutSine);
}
s3.onRelease = function() {
	s1.colorTo(0x000000, 0.5, easeoutSine);
	s2.colorTo(0x000000, 0.5, easeoutSine);
	s3.colorTo(0x0099FF, 0.5, easeoutSine);
	s4.colorTo(0x000000, 0.5, easeoutSine);
	s5.colorTo(0x000000, 0.5, easeoutSine);
}
s4.onRelease = function() {
	s1.colorTo(0x000000, 0.5, easeoutSine);
	s2.colorTo(0x000000, 0.5, easeoutSine);
	s3.colorTo(0x000000, 0.5, easeoutSine);
	s4.colorTo(0x0099FF, 0.5, easeoutSine);
	s5.colorTo(0x000000, 0.5, easeoutSine);
}
s5.onRelease = function() {
	s1.colorTo(0x000000, 0.5, easeoutSine);
	s2.colorTo(0x000000, 0.5, easeoutSine);
	s3.colorTo(0x000000, 0.5, easeoutSine);
	s4.colorTo(0x000000, 0.5, easeoutSine);
	s5.colorTo(0x0099FF, 0.5, easeoutSine);
}

```

Thank you for any advice.  
Paul.
