PDA

View Full Version : error # 1063 ---- (event:MouseEvent) is there...


chemicaluser
09-06-2008, 04:12 PM
Hi everyone, I'm just playing around in flash and I am trying to figure out how to solve this error.

ArgumentError: Error #1063: Argument count mismatch on banner/directoryFocusOut(). Expected 0, got 1.

I have done some reading up but I can't figure out what is causing the error b/c my function does have the evt:MouseEvent.



var timeCounter = 0;
b1.buttonMode = true;
b1.addEventListener(MouseEvent.CLICK, f_b1click)
function f_b1click (evt:MouseEvent) :void {
if (timeCounter == 0) {
TweenMax.to(aboutustext, 3, {alpha:0, y:560, ease:Expo.easeOut});
TweenMax.to(mcdark, 3, {delay:2, alpha:0, x:-960 ,ease:Expo.easeOut});
++timeCounter;
setTimeout(f_b1click,5000); //1000 = one second delay
} else {
MovieClip(this.parent).gotoAndPlay(2);
timeCounter = 0;
}
}


Any suggestions would be appretiated.

Thanks

senocular
09-06-2008, 04:19 PM
You error and the code you posted do not relate to each other. Where is your directoryFocusOut function?

chemicaluser
09-06-2008, 04:28 PM
You error and the code you posted do not relate to each other. Where is your directoryFocusOut function?

lol, sorry I copy and pasted the error form a google page.. but its the same error

my error is

ArgumentError: Error #1063: Argument count mismatch on newed2_fla::mcdark_2/f_b1click(). Expected 1, got 0.
at Function/http://adobe.com/AS3/2006/builtin::apply()
at ()
at flash.utils::SetIntervalTimer/flash.utils:SetIntervalTimer::onTimer()
at flash.utils::Timer/flash.utils:Timer::_timerDispatch()
at flash.utils::Timer/flash.utils:Timer::tick()

senocular
09-06-2008, 04:48 PM
You've defined f_b1click with a required evt parameter. when you use it with setTimeout it gets called with no parameters causing the error.

You have two options; make the evt parameter optional by giving it a default null value in the parameter list (evt:MouseEvent = null), or you can pass in null or some dummy event as an argument through setTimeout (setTimeout(f_b1click,5000, null); )

chemicaluser
09-06-2008, 05:08 PM
THANK YOU
:)

it worked.