# Limit of 3 arguments for function ? What is happening here:

**URL:** <https://forum.kirupa.com/t/limit-of-3-arguments-for-function-what-is-happening-here/309207>\
**Category:** flash\
**Created:** [May 10, 2010, 12:57am UTC](https://forum.kirupa.com/t/limit-of-3-arguments-for-function-what-is-happening-here/309207 "2010-05-10T00:57:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shaedo](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@Shaedo](https://forum.kirupa.com/u/Shaedo)\
**Post date:** [May 10, 2010, 12:57am UTC](https://forum.kirupa.com/t/limit-of-3-arguments-for-function-what-is-happening-here/309207/1 "2010-05-10T00:57:52Z")

</div>

```auto
var menu:MovieClip = asdf();

function asdf(s:String='', myx:int=0, p:MovieClip=null):MovieClip // eventual crash with a stackOverflow error
//function asdf(s:String='', myx:int=0):MovieClip // works fine
//function asdf(p:MovieClip=null,s:String=''):MovieClip //works fine
//function asdf(a:String='',b:String='',c:String=''):MovieClip// eventuall crashes with a stackOverflow error
{
	var m:MovieClip = new MovieClip();
	return (m);
}

```

I guess this is fairly self explanatory, I am curious why I am getting errors from the functions with more than 2 arguments. I know I could use ‘…rest’ as a work around but I really thought that this should work fine.

from reading through the docs this should work fine.  
[http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/arguments.html](http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/arguments.html)
