# The same code over and over ad nauseam

**URL:** <https://forum.kirupa.com/t/the-same-code-over-and-over-ad-nauseam/153492>\
**Category:** Uncategorized\
**Created:** [July 1, 2005, 8:28pm UTC](https://forum.kirupa.com/t/the-same-code-over-and-over-ad-nauseam/153492 "2005-07-01T20:28:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![PaintedSwan](https://avatars.discourse-cdn.com/v4/letter/p/90db22/32.png) [@PaintedSwan](https://forum.kirupa.com/u/PaintedSwan)\
**Post date:** [July 1, 2005, 8:28pm UTC](https://forum.kirupa.com/t/the-same-code-over-and-over-ad-nauseam/153492/1 "2005-07-01T20:28:19Z")

</div>

I know there is probably a shorter way to write this, but I am really not experienced enough in AS yet to know how to condense it. Anyone have an idea of how to simplify this way-too-long code? Thanks in advance. 🙂

```auto

onEnterFrame = function () { 
 if (journals_clip.rewind == true) {
  journals_clip.prevFrame();
 }
 if (linkstween_mc.rewind == true) {
  linkstween_mc.prevFrame();
 }
 if (leaf9.rewind == true) {
  leaf9.prevFrame();
 }
 if (leaf8.rewind == true) {
  leaf8.prevFrame();
 }
 if (hometween_mc.rewind == true) {
  hometween_mc.prevFrame();
 }
 if (leaf6.rewind == true) {
  leaf6.prevFrame();
 }
 if (journalstween_mc.rewind == true) {
  journalstween_mc.prevFrame();
 }
 if (poetrytween_mc.rewind == true) {
  poetrytween_mc.prevFrame();
 }
 if (leaf3.rewind == true) {
  leaf3.prevFrame();
 }
 if (_root.header.rewind == true) {
  _root.header.prevFrame();
 }
 if (leaf1.rewind == true) {
  leaf1.prevFrame();
 }
 if (picturestween_mc.rewind == true) {
  picturestween_mc.prevFrame();
 }
 if (leaf2.rewind == true) {
  leaf2.prevFrame();
 }
 if (artween_mc.rewind == true) {
  artween_mc.prevFrame();
 }
};

```

[size=2]

[/size]
