# Argument count mismatch (and other problems)

**URL:** <https://forum.kirupa.com/t/argument-count-mismatch-and-other-problems/324402>\
**Category:** flash\
**Created:** [August 18, 2011, 9:03pm UTC](https://forum.kirupa.com/t/argument-count-mismatch-and-other-problems/324402 "2011-08-18T21:03:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![PaxForce](https://avatars.discourse-cdn.com/v4/letter/p/df788c/32.png) [@PaxForce](https://forum.kirupa.com/u/PaxForce)\
**Post date:** [August 18, 2011, 9:03pm UTC](https://forum.kirupa.com/t/argument-count-mismatch-and-other-problems/324402/1 "2011-08-18T21:03:49Z")

</div>

I tried to modify the AS2 to AS3, but I messed it up ☹  
My e-mail [stretavkaBB@gmail.com](mailto:stretavkaBB@gmail.com) Thank you

\*\*\*error:\*\*\*  
Argument count mismatch on NewWebSiteULTIMATE4\_fla::MainTimeline/searchB(). Expected 0, got 1.

\*\*\*code:\*\*\*  
var directory:Array = [{name:“0044”, phone:" 100 292 592 “},  
{name:“0038”, phone:” 100 291 597 “},  
{name:“9030”, phone:” 99 277 579 "},  
];

function getPhoneByName(name:String):String {  
for(var i:Number = 0; i \< directory.length; i++) {  
if(directory\*.name.toLowerCase() == name.toLowerCase()) {  
return directory\*.phone;  
}  
}  
return " -";

}

searchButton.addEventListener(MouseEvent.CLICK, searchB);

function searchB() {  
getPhoneByName(nameField.text);  
}
