# If...then?

**URL:** <https://forum.kirupa.com/t/if-then/14317>\
**Category:** Uncategorized\
**Created:** [February 25, 2003, 12:51am UTC](https://forum.kirupa.com/t/if-then/14317 "2003-02-25T00:51:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![cookie](https://avatars.discourse-cdn.com/v4/letter/c/d26b3c/32.png) [@cookie](https://forum.kirupa.com/u/cookie)\
**Post date:** [February 25, 2003, 12:51am UTC](https://forum.kirupa.com/t/if-then/14317/1 "2003-02-25T00:51:40Z")

</div>

Ok I’m an actionscript newbie! I’m trying to make one function begin once another function has stopped, make sense?

ex.

function 1 (){}  
function 2 (){}

when function 1(); is complete  
start function 2();

I tried using an if statement:

if(function 1() == “something”){  
function 2()  
}

don’t know what the “something” should be! :sure:

---

<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:** [February 25, 2003, 2:10am UTC](https://forum.kirupa.com/t/if-then/14317/2 "2003-02-25T02:10:15Z")

</div>

… hmmm :sigh:

**something** would be anything you want it to be !!

read this tutorial by ilyas  
[http://www.kirupa.com/developer/actionscript/tricks/dynamicevent.asp](http://www.kirupa.com/developer/actionscript/tricks/dynamicevent.asp)

---

<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:** [February 25, 2003, 2:12am UTC](https://forum.kirupa.com/t/if-then/14317/3 "2003-02-25T02:12:32Z")

</div>

try

```php

if (function1()) { function2()}

```

if not, try adding this line at the end of function 1

```php

return true

```

---

<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:** [February 25, 2003, 9:21am UTC](https://forum.kirupa.com/t/if-then/14317/4 "2003-02-25T09:21:31Z")

</div>

No if I use return true then both functions happen simultaneously! Let me clarify what I have

```php
onClipEvent(load){
function xscale(){
if statement in here
}
function yscale(){
if statement in here
    }
}
onClipEvent(enterFrame){
xscale();
}

```

Ok this works and will evaluate function xscale, but as soon as that function is complete I want to evalute yscale!:q:

---

<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:** [February 25, 2003, 9:02pm UTC](https://forum.kirupa.com/t/if-then/14317/5 "2003-02-25T21:02:38Z")

</div>

Could someone please help me out with this! (-:

---

<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:** [February 25, 2003, 11:27pm UTC](https://forum.kirupa.com/t/if-then/14317/6 "2003-02-25T23:27:32Z")

</div>

use **dynamic event handlers** cookieme 🙂

again … [http://www.kirupa.com/developer/actionscript/tricks/dynamicevent.asp](http://www.kirupa.com/developer/actionscript/tricks/dynamicevent.asp)
