# 5 function make it just one

**URL:** <https://forum.kirupa.com/t/5-function-make-it-just-one/38939>\
**Category:** flash\
**Created:** [January 1, 2004, 5:36am UTC](https://forum.kirupa.com/t/5-function-make-it-just-one/38939 "2004-01-01T05:36:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![FlashSwimmer](https://avatars.discourse-cdn.com/v4/letter/f/35a633/32.png) [@FlashSwimmer](https://forum.kirupa.com/u/FlashSwimmer)\
**Post date:** [January 1, 2004, 5:36am UTC](https://forum.kirupa.com/t/5-function-make-it-just-one/38939/1 "2004-01-01T05:36:28Z")

</div>

:?) Happy New Year ::: 2004 :::: :?)

hi guys…  
if i have 5 function and i want to make them in just one… the difference between them just in the name of the movie clip…  
here Exp. for 3 :  
[AS]  
function homeClickreturn() {  
if (\_root.mc\_apLink1.\_currentframe == 10) {  
\_root.mc\_apLink1.play();  
}  
}  
function homeClickreturn2() {  
if (\_root.mc\_apLink2.\_currentframe == 10) {  
\_root.mc\_apLink2.play();  
}  
if (\_root.mc\_apmain2.\_currentframe == 5) {  
\_root.mc\_apmain2.play();  
}  
}  
function homeClickreturn3() {  
if (\_root.mc\_apLink3.\_currentframe == 10) {  
\_root.mc\_apLink3.play();  
}  
if (\_root.mc\_apmain3.\_currentframe == 5) {  
\_root.mc\_apmain3.play();  
}  
}[/AS]  
thanx

---

<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:** [January 1, 2004, 5:57am UTC](https://forum.kirupa.com/t/5-function-make-it-just-one/38939/2 "2004-01-01T05:57:12Z")

</div>

[AS]if (condition)  
{  
do this  
}  
else if (another condition)  
{  
do this  
}  
else if (another another condition)  
{  
do this  
}  
[/AS]

Is this what you mean??? You might already know 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:** [January 1, 2004, 8:31am UTC](https://forum.kirupa.com/t/5-function-make-it-just-one/38939/3 "2004-01-01T08:31:23Z")

</div>

i wonder if i can make it by prototype… i looking forward to do it by this feature…  
is it possible :h:

---

<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:** [January 1, 2004, 12:04pm UTC](https://forum.kirupa.com/t/5-function-make-it-just-one/38939/4 "2004-01-01T12:04:52Z")

</div>

> \*Originally posted by FlashSwimmer \*  
> \*\*i wonder if i can make it by prototype… i looking forward to do it by this feature…  
> is it possible :h: \*\*

thats the way to go 😉

```auto
MovieClip.prototype.homeClickreturn = function () {
        if (this._currentframe == 10) {
                this.play();
        }
};

// use:
_root.mc_apLink2.homeClickreturn();

```
