# Argument count mismatch..problem

**URL:** <https://forum.kirupa.com/t/argument-count-mismatch-problem/306310>\
**Category:** Uncategorized\
**Created:** [March 12, 2010, 7:10pm UTC](https://forum.kirupa.com/t/argument-count-mismatch-problem/306310 "2010-03-12T19:10:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Elementss](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/elementss/32/1698_2.png) [@Elementss](https://forum.kirupa.com/u/Elementss)\
**Post date:** [March 12, 2010, 7:10pm UTC](https://forum.kirupa.com/t/argument-count-mismatch-problem/306310/1 "2010-03-12T19:10:30Z")

</div>

Hello,

i need to get a number and an Event to a function but I’m failing to add the code to add the number value when i call the function :\

my code:

```auto
var loaderBODY:URLLoader = new URLLoader();
loaderBODY.addEventListener(Event.COMPLETE,loadXMLBODY);
loaderBODY.load(new URLRequest("TXTDATA.XML"));
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
function loadXMLBODY(e:Event,i:Number):void {
....
....
....

```

and becouse i need 2 arguments i get:

```auto
ArgumentError: Error #1063: Argument count mismatch on SALESbuylowTMPTMPTMP333fla_fla::P1IMGS_mc_2/loadXMLBODY(). Expected 2, got 1.
	at flash.events::EventDispatcher/dispatchEventFunction()
	at flash.events::EventDispatcher/dispatchEvent()
	at flash.net::URLLoader/onComplete()

```

As you can see the function “loadXMLBODY” needs those 2 arguments\>\>\>\>(e:Event,i:Number)  
and the way i did it - it gives me an Error:

```auto
var loaderBODY:URLLoader = new URLLoader();
[SIZE="5"][COLOR="DarkRed"]**loaderBODY.addEventListener(Event.COMPLETE,loadXMLBODY(CountPage));**[/COLOR][/SIZE]
loaderBODY.load(new URLRequest("TXTDATA.XML"));
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
function loadXMLBODY(e:Event,i:Number):void {

```

**How i can call the Function when my URL LOADER \> “loaderBODY” ends his load with 2 arguments?**

appreciate any Help…

Stas.:pope:
