5 function make it just one

:?) 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

[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!!!

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

*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 :wink:

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

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