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:
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')
}
}
}
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