# Multiple Function Calls

**URL:** <https://forum.kirupa.com/t/multiple-function-calls/29061>\
**Category:** flash\
**Created:** [August 21, 2003, 5:49pm UTC](https://forum.kirupa.com/t/multiple-function-calls/29061 "2003-08-21T17:49:44Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kovax](https://avatars.discourse-cdn.com/v4/letter/k/7ab992/32.png) [@Kovax](https://forum.kirupa.com/u/Kovax)\
**Post date:** [August 21, 2003, 5:49pm UTC](https://forum.kirupa.com/t/multiple-function-calls/29061/1 "2003-08-21T17:49:44Z")

</div>

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:

---

<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:** [August 21, 2003, 8:53pm UTC](https://forum.kirupa.com/t/multiple-function-calls/29061/2 "2003-08-21T20:53:11Z")

</div>

can you provide your function declarations for these functions?

---

<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:** [August 21, 2003, 8:58pm UTC](https://forum.kirupa.com/t/multiple-function-calls/29061/3 "2003-08-21T20:58:33Z")

</div>

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;  
}  
}

---

<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:** [August 21, 2003, 8:59pm UTC](https://forum.kirupa.com/t/multiple-function-calls/29061/4 "2003-08-21T20:59:53Z")

</div>

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.

---

<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:** [August 21, 2003, 9:18pm UTC](https://forum.kirupa.com/t/multiple-function-calls/29061/5 "2003-08-21T21:18:49Z")

</div>

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

---

<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:** [August 21, 2003, 9:33pm UTC](https://forum.kirupa.com/t/multiple-function-calls/29061/6 "2003-08-21T21:33:49Z")

</div>

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:

---

<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:** [August 21, 2003, 9:50pm UTC](https://forum.kirupa.com/t/multiple-function-calls/29061/7 "2003-08-21T21:50:00Z")

</div>

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

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

```

or something to that effect.
