I have a method
public function show (text:Object="", title:String="", body=String=""){
//blah
}
I want text to get the default value, and pass in values for the other two parameters. I was wondering if there is some way I can call it as such
show(title="sample", body="xyz");
Sorry if this question is really basic, I just started picking up Actionscript, and my limited googling skills didn’t return any fruitful results.
In contrast to the other answers, you could do this:
And then:
I of course advise against this for reasons related to code readability and maintainability, but it’s still useful info.
If you do decide to use this approach, be sure to document your methods clearly, e.g.