Repeating actions without keyframes

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!

if i understood your question…

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

was i right or wrong? :stuck_out_tongue:

That works great. Thanks :slight_smile:

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.

well, you can do pretty much anything… :wink:

and you’re welcome. =)