# Is it possible to condense this Actionscript?

**URL:** https://forum.kirupa.com/t/is-it-possible-to-condense-this-actionscript/219381
**Category:** flash
**Created:** [March 16, 2007, 12:40am UTC](https://forum.kirupa.com/t/is-it-possible-to-condense-this-actionscript/219381 "2007-03-16T00:40:41Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![lacohido](https://avatars.discourse-cdn.com/v4/letter/l/e8c25b/32.png) [@lacohido](https://forum.kirupa.com/u/lacohido)
#### Post date: [March 16, 2007, 12:40am UTC](https://forum.kirupa.com/t/is-it-possible-to-condense-this-actionscript/219381/1 "2007-03-16T00:40:41Z")

</div>

```auto

swatch1.onEnterFrame = function () {
	this._rotation += (-3 - this._rotation)/speed;
	if (this._rotation<=-3) {delete this.onEnterFrame;}
}

swatch2.onEnterFrame = function () {
	this._rotation += (-6 - this._rotation)/speed;
	if (this._rotation<=-6) {delete this.onEnterFrame;}
}

swatch3.onEnterFrame = function () {
	this._rotation += (-9 - this._rotation)/speed;
	if (this._rotation<=-9) {delete this.onEnterFrame;}
}

swatch4.onEnterFrame = function () {
	this._rotation += (-12 - this._rotation)/speed;
	if (this._rotation<=-12) {delete this.onEnterFrame;}
}

```

Sorry for this noob Q, but is it possible to condense this Actionscript? Is it possible to use a loop or something?  
Thanks for the Help!!!
