# dispatchEvent - argument count mismatch

**URL:** <https://forum.kirupa.com/t/dispatchevent-argument-count-mismatch/319927>\
**Category:** flash\
**Created:** [March 9, 2011, 4:28am UTC](https://forum.kirupa.com/t/dispatchevent-argument-count-mismatch/319927 "2011-03-09T04:28:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dvdwmth](https://avatars.discourse-cdn.com/v4/letter/d/779978/32.png) [@dvdwmth](https://forum.kirupa.com/u/dvdwmth)\
**Post date:** [March 9, 2011, 4:28am UTC](https://forum.kirupa.com/t/dispatchevent-argument-count-mismatch/319927/1 "2011-03-09T04:28:19Z")

</div>

I’m trying to send an event between a loaded swf and the swf its loaded into but I’m getting the following error.

ArgumentError: Error #1063: Argument count mismatch on one/eventResponse(). Expected 0, got 1.  
at flash.events::EventDispatcher/dispatchEventFunction()  
at flash.events::EventDispatcher/dispatchEvent()  
at two/test()

I don’t understand where this extra argument is coming from.  
The code is below:

[//one.as](https://one.as)

package {

```
import flash.display.MovieClip;
import flash.net.URLRequest;
import flash.display.Loader;

public class one extends MovieClip {
    
    
    public function one() {
            var loader:Loader = new Loader()
            var req:URLRequest = new URLRequest('two.swf')
            loader.load(req);
            addChild(loader)
            
            addEventListener('hi', eventResponse)
            
            
        }
        
        public function eventResponse()
        {
            trace(' event recieved')
        }
    }
}

```

[//two.as](https://two.as)

package {

```
import flash.display.MovieClip;
import flash.events.Event;
import flash.events.MouseEvent;

public class two extends MovieClip {
    
    
    public function two() 
    {
        yellow_mc.addEventListener(MouseEvent.MOUSE_DOWN, test)
    }
    
    public function test(e:MouseEvent)
    {
        dispatchEvent(new Event('hi', true))
    }
}

```

}

Thanks,

David
