Multiple OnEnterFrame functions

I have a series of functions that i want to add to a movie clip through the OnEnterFrame command, however i cant get more than one to run at the same time. Is it possible to have more than one going when u are dynamically creating them?

Thanks

yes it’s possible but make sure the functions are created before triggering them!
and it will trigger them ina specific order!
eg
onClipEvent(enterFrame) {
function1();
function2();
function3();
}

it will trigger them in this order: first function1 then the second and then the third. starting from the top… so make sure the action for triggering the function is not somewhere above the function itself!

sorry, i dont think i explained what i meant properly, which would help i know!

Im setting the functions up at the start of the movie in a frame script, in this case its two functions, one for the _x and one for the _y location of a movieclip. Then at a given moment i send both these functions new co-ordinates and the functions ‘create’ OnEnterFrame scripts onto the named movieclip which then runs the scripts in the functions. The problem is that the second function, _y replaces the _x script. One OnEnterFrame overides the other.

I guess basically i want away of just adding scripts to the OnEnterFrame rather than assigning them from scratch.

so you’re saying that you have something like this?

function1 = function() {
this.onEnterFrame = function() {
statement(s);
}
}
function2 = function() {
this.onEnterFrame = function() {
statement(s);
}
}
myMovieClip.function1();
myMovieClip.function2();

if so… you can’t. like you said, the onEnterFrame handler created in function1 will be replaced by the onEnterFrame handler created in function2 :-\

syko is right. you’d need to do something like this:

function1 = function() {
statement(s);
}
function2 = function() {
statement(s);
}
myMovieClip.onEnterFrame = function() {
this.function1();
this.function2();
}

:wink: