2 Replies Latest reply on May 22, 2009 3:34 AM by Raja Himanath

    Error 1137: Incorrect number of arguments.

    Raja Himanath Level 1

      Hi I have just written a value object class as the code shown below



      package mypack


      public class ValueObject


      public function ValueObject(_name:String,empId:String,_isMarried:Boolean,_salary:Number ){


      this.empId=empId;//this key word is used to avoid naming collision




      private var name:String;

      private var empId:String;

      private var isMarried:Boolean;

      private var salary:Number;


      public function buildObject(obj:Object):ValueObject{

      var vo:ValueObject=

      new ValueObject(obj.name,obj.empId,obj.isMarried,obj.salary);

      return vo;


      public function toString():String{

      return "any value like even your object values";





      Now thought of using this in my mxml code

      my mxml code is like this and still i have not completed writing the code but showing error at the object creation line

      the code is



      <?xml version="1.0" encoding="utf-8"?>

      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">



      import mx.collections.ArrayCollection;

      import mypack.ValueObject;

      public var vobj:ValueObject=new ValueObject("Raja","bits-33",false,15000);//ERROR AT THIS LINE






      1137: Incorrect number of arguments. Expected no more than 0. is the error it is showing and also I am not able to access any of the method from the vo.as ie from the instance of vobj and I am not getting any methods in the downlist. What might be the cause please help me in solving this.


      Thanks in Advance