Multiple Function Calls

I have some code that calls multiple functions for a single movie clip during a single event. For example:

portfolioButton.onPress = function()
{
redClip.easeX(180, speed);
redClip.easeHeight(194, speed);
}

The problem is only the first function call works (redClip.easeX(180, speed)). Is there a way for both function calls to execute? Perhaps delay the second one?

Thanks!

:mario:

can you provide your function declarations for these functions?

They are both simple functions used to ease a property of the movie clip.

function easeX(endX, speed)
{
//trace(“easeX function reached.”);
this.onEnterFrame = function()
{
this._x += (endX-this._x)/speed;
}
}
function easeHeight(endHeight, speed)
{
// trace(“easeHeight function reached.”);
this.onEnterFrame = function()
{
this._height += (endHeight-this._height)/speed;
}
}

ah, just as i thought you are trying to assign two onEnterFrames to the same clip. You can’t do that. Why don’t you just include the code of both functions in one big one? you can use as many parameters as you need.

That makes sense…didn’t even think of that. Thanks!

Is there a way to control when the function calls execute? Can I ease the height and THEN the _x in that order? I am trying to avoid tweened animation.

:block:

um, you can tell the _x to move once the height gets past a certain point. like

if (_height > 50) {
_x += 5;
}

or something to that effect.