ArgumentError: Error #1063: Argument count mismatch on banner/directoryFocusOut(). Expected 0, got 1.
I received this error when an event handler I created did not contain an expected parameter. Somehow the compiler missed it but an error was thrown in the browser. The fix was easy. I forgot to add in the event object. Adding that in fixed the problem.
directorySearch_txt.addEventListener(FocusEvent.FOCUS_OUT, directoryFocusOut);
// this line generated no errors in flex but generated errors at run time
public function directoryFocusOut():void {
// do something
}
// adding the event object cleared the error
public function directoryFocusOut(event:FocusEvent):void {
// do something
}
Please reply in the comments below if this helped you or not. You can also use the Error Lookup Tool to look up Flex compiler or runtime errors. more info…
Are you writing own version of LiveDocs? ;)
Anyway, I appreciate your effors, I kinda receive this error too often with my custom Events too :)
Yes. :)
I use the live docs but do not think their error section is very thorough. Plus sometimes I would like an answer in plain English to help myself when I get an error and am not thinking clearly. :)
Thanks so much! That error was so vague!
thanks a lot! my script had the same problem…. works now :) appreciate it!
THANKS!!
Thanks, same case I had
thanks, really helpful information:)
Yeah, thanks, wasted 4 hours of my life to locate the error, damn Flash
exactly!
thanks!!
thanks, really helpful information:)
Great! solved my problem in a sec!
Wow, thank you very much for this post.
Knocked my head against the wall until i found this…. seriously
Thanks!
Hi,
This is very helpful to all people like me, new in flex.
Thanx a lot
This was EXTREMELY helpful. Doh!!
Thanks for taking the time post. Sweet:)
Very helpful for a pseudo coder like myself. Thanks!
thanks so much, worked like a charm
thanx . it really helped to solve the problem . Nice work !
!Amar Shukla!
thanks a lot !! you’ve helped me solve a problem!!!
Can also happen with a class constructor that wants arguments, but underlying code needs to create objecs without arguments (i.e. using remote objects):
THIS DOESN’T WORK:
private var name:String;
public function Foo(name:String):Foo {
_name=name;
}
THIS DOES WORK:
private var name:String;
public function Foo() {}
public static function createFoo(name:String):Foo {
trace(name);
var foo:Foo=new Foo();
foo.name=name;
return foo;
}
btw, that pain could also be solved by below example
public function fncname(evt:Event = null){
// your code here..
}
Yes, simple problem, but it can take you some time if you’re not sure what it is.
Thank you, you solved my problem. ;-)
Thank you so much, solved my problem!
Thanks a lot,it solved my problem…
Thank you guy
a lot
it’s solved my problem
i don’t know if you will understand me, but how we say in Brazil:
TU É FODA MERMÃO!!
Hey there. I got this error from calling a function located on the stage from within a child on the main stage. Adding the event object not only doesn’t remove the error, but also prevents the function from working at all. Currently it doesn’t affect the code, but the fact that the error is persistant does annoy me.
Here is my function on the stage (yes this code is for a Flash-based RPG):
function attack(event:Event):void {
var playerDamage = playerStrength – enemyDefence;
var enemyCurrentHealth = enemyHealth – playerDamage;
//Player HP
enemyHealth -= playerDamage;
trace(“The enemy’s health is “+enemyCurrentHealth);
enemyHP.text = String(enemyCurrentHealth);
//Play victory screen
if (enemyHealth
Thanks for this info…. It was very helpful……
Thankyou!
ArgumentError: Error #1063: Argument count mismatch on 01_intro_fla::MainTimeline/dynotex(). Expected 0, got 1.
my code is……btnResolution.addEventListener(MouseEvent.ROLL_OVER, dynotex);
function dynotex() {
definition.text = “RESOLUTION is blah di blah….2 lines of sample dynamic text”
}
Im tryn to pull some dyno txt i keep gettin the same error
Thanks! Your fix is a godsend, I was annoyed by this error and was about to gave up!
Such a great and easy fix. Thank you!!!!
Such a helpful and easy fix. Just what I needed, thank you.
Thanks dude you’ve saved my life :P
exactly what I needed. Thanks!
Thanks alot :) that saved me hours of searching :)
Thanks!
Saved me from lots of befuddlement.
Hey!.. thanks, very easy the workaround and easy to understand.
That’s the most important I think.
thanks