Hi All,
I’ve set up two functions (friendsClick and policyLink) I would like to use everything inside of friendsClick inside of policyLink but I’m not sure how to go about doing it. I get the following error:
1136: Incorrect number of arguments. Expected 1.
My code looks similar to:
function policyLink(e:MouseEvent){
friendsClick();
"all my other info here"
}
I can just copy everything from the friendsClick function and paste, but I’m trying to limit my amount of repetitive code (I’m trying to get better at that). Please Help.
You probably should have posted more of the relevant code, since I can think of a few things that might be causing the issue.
Try:
function policyLink(e:MouseEvent = null)
Or:
friendsClick(null);
It’s probably the first one, but I can’t be sure.
[quote=flashdaddy;2351697]Hi All,
I’ve set up two functions (friendsClick and policyLink) I would like to use everything inside of friendsClick inside of policyLink but I’m not sure how to go about doing it. I get the following error:
1136: Incorrect number of arguments. Expected 1.
My code looks similar to:
function policyLink(e:MouseEvent){
friendsClick();
"all my other info here"
}
I can just copy everything from the friendsClick function and paste, but I’m trying to limit my amount of repetitive code (I’m trying to get better at that). Please Help.[/quote]
I got the problem solved. Apparently you can’t put a function inside another function when you have an event listener associated with it. I had to do something like this:
oldFunction.addEventListener(MouseEvent.CLICK, btn_Fade);
function oldFunction(e:MouseEvent){
newFunction();
}
function newFunction(e:MouseEvent){
"all my functions"
}
Something like that anyway. It worked out for me though. Thanks to all those who helped out.