# Repeating actions without keyframes

**URL:** <https://forum.kirupa.com/t/repeating-actions-without-keyframes/23106>\
**Category:** Uncategorized\
**Created:** [June 12, 2003, 9:36pm UTC](https://forum.kirupa.com/t/repeating-actions-without-keyframes/23106 "2003-06-12T21:36:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rendark](https://avatars.discourse-cdn.com/v4/letter/r/50afbb/32.png) [@rendark](https://forum.kirupa.com/u/rendark)\
**Post date:** [June 12, 2003, 9:36pm UTC](https://forum.kirupa.com/t/repeating-actions-without-keyframes/23106/1 "2003-06-12T21:36:34Z")

</div>

I’m wondering if it’s possible to make an action repeat itself once every frame, without using new keyframes.  
I want to have a specified target in every frame on one layer, and then have my script layer set with only one keyframe to load the movie afresh into the target at every frame.

For example,

I have two scripts layers. One with keyframes at every frame. This one has the following content:  
var pic;  
var holder;

pic=“somePicture.jpg”; //this picture changes at each frame  
holder=“c1”; // this blank movieclip instance name also changes

stop();

The layer with only one keyframe, but loads of frames says this:  
loadMovie(pic, holder);  
holder.loadMovie(pic);  
holder.\_x = holder.\_y = 20;

I want this last to repeat once at every frame without (without using keyframes) having to paste it in 50 times or so.

Anyway, thanks for any advice/knowledge that you have to offter!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 12, 2003, 9:57pm UTC](https://forum.kirupa.com/t/repeating-actions-without-keyframes/23106/2 "2003-06-12T21:57:09Z")

</div>

if i understood your question…

```auto
var frame;
holder._x = holder._y=20;
this.onEnterFrame = function() {
	if (frame != (frame=this._currentframe)) {
		holder.loadMovie(pic);
	}
};

```

was i right or wrong? 😛

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 12, 2003, 10:34pm UTC](https://forum.kirupa.com/t/repeating-actions-without-keyframes/23106/3 "2003-06-12T22:34:57Z")

</div>

That works great. Thanks 🙂

I actually figured out something similar after my first post that worked, but yours takes less code. Thanks!

I didn’t know you could compare and assign at the same time, or compare something being assigned, in if statements. Well, you know what I mean. That’s cool.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 12, 2003, 10:58pm UTC](https://forum.kirupa.com/t/repeating-actions-without-keyframes/23106/4 "2003-06-12T22:58:43Z")

</div>

well, you can do pretty much anything… 😉

and you’re welcome. =)
