# \[CS3|AS2\]Ways to call functions and pass arguments

**URL:** <https://forum.kirupa.com/t/cs3-as2-ways-to-call-functions-and-pass-arguments/258297>\
**Category:** flash\
**Created:** [April 22, 2008, 7:59pm UTC](https://forum.kirupa.com/t/cs3-as2-ways-to-call-functions-and-pass-arguments/258297 "2008-04-22T19:59:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![audiohominis](https://avatars.discourse-cdn.com/v4/letter/a/c68b51/32.png) [@audiohominis](https://forum.kirupa.com/u/audiohominis)\
**Post date:** [April 22, 2008, 7:59pm UTC](https://forum.kirupa.com/t/cs3-as2-ways-to-call-functions-and-pass-arguments/258297/1 "2008-04-22T19:59:42Z")

</div>

Hi, guys.  
ActionScript Code:  
[FONT=Courier New][LEFT][COLOR=#000000] **var** [/COLOR] fancyWord:[COLOR=#0000ff]String[/COLOR] = [COLOR=#000000] **new** [/COLOR] [COLOR=#0000ff]String[/COLOR]COLOR=#000000[/COLOR];  
[COLOR=#000000] **function** [/COLOR] traceWIHOUTargumentCOLOR=#000000[/COLOR][COLOR=#808080]_//does not accept arguments_[/COLOR]  
[COLOR=#000000]{[/COLOR]  
[COLOR=#0000ff]trace[/COLOR]COLOR=#000000[/COLOR];  
[COLOR=#000000]}[/COLOR]

[COLOR=#000000] **function** [/COLOR] traceWITHargumentCOLOR=#000000[/COLOR][COLOR=#808080]_//accepts arguments_[/COLOR]  
[COLOR=#000000]{[/COLOR]  
[COLOR=#0000ff]trace[/COLOR]COLOR=#000000[/COLOR];  
[COLOR=#000000]}[/COLOR]

[COLOR=#808080]_//CASE 1:_[/COLOR]  
[COLOR=#0000ff]button[/COLOR].[COLOR=#0000ff]onRelease[/COLOR] = [COLOR=#000000] **function** [/COLOR]COLOR=#000000[/COLOR]  
[COLOR=#000000]{[/COLOR]  
traceWIHOUTargument;[COLOR=#808080]_//the LONGER way to call a function that DOES NOT accept arguments…_[/COLOR]  
[COLOR=#000000]}[/COLOR][COLOR=#808080]_//declare a function that calls another function_[/COLOR]

[COLOR=#808080]_//CASE 2:_[/COLOR]  
[COLOR=#0000ff]button[/COLOR].[COLOR=#0000ff]onRelease[/COLOR] = traceWIHOUTargument;[COLOR=#808080]_//the SHORTER way to call a function that DOES NOT accept arguments…_[/COLOR]

[COLOR=#808080]_//CASE 3:_[/COLOR]  
[COLOR=#0000ff]button[/COLOR].[COLOR=#0000ff]onRelease[/COLOR] = [COLOR=#000000] **function** [/COLOR]COLOR=#000000[/COLOR]  
[COLOR=#000000]{[/COLOR]  
traceWITHargumentCOLOR=#000000[/COLOR];[COLOR=#808080]_//the LONGER way to call a function that ACCEPTS arguments…_[/COLOR]  
[COLOR=#000000]}[/COLOR][COLOR=#808080]_//declare a function that calls another function_[/COLOR]

[COLOR=#808080]_///CASE 4:_[/COLOR]  
[COLOR=#808080]_//How about the SHORTER way to call a function that ACCEPTS arguments?_[/COLOR]  
[COLOR=#808080]\*//how do you pass an argument in that case? \*[/COLOR]

[/LEFT]  
[/FONT]

Thanks
