3 Replies Latest reply on Sep 7, 2015 2:17 AM by tanvira5454192

    Error: Multiple markers at this line: -1137: Incorrect number of arguments. Expected no more than 0.

    memBrainStudios

      I am experimenting with implementing a custom 3D rendering engine for flash.  I have only just started working on the framework, and am testing the very little amount of code I've written thus far and I am getting this error. I am working in the Flash Builder 4 IDE through Eclipse.  My project is set up as an ActionScript project.  Here is the code I have written:

       

      My3DDriver.as: Driver to test code changes (I intend for this to be a library, so this file is only temporary.)

      package my3D {
           import flash.display.Sprite;
           import my3D.geometry.*;
           
           public class My3DDriver extends Sprite {
                private var point:Point;
                
                public function My3DDriver() {
                     run();
                }
                
                private function run():void {
                     point = new Point(2,3,4);
                     trace(point);
                }
           }
      }
      

       

      Vector.as: Custom Vector implementation.  (Supposed to take in any arbitrary number of Number, int or uint's and store them in an array type cast as Number.)

      package my3D.geometry {
           public class Vector {
                // Properties
                private var length:uint;
                private var vector:Array;
                
                // Constructor
                public function Vector(...args) {
                     length = args.length;
                     for (var i:uint = 0; i < args.length; i++) {
                          vector[i] = Number(args[i]);
                     }
                }
           }
      }
      

       

      Point.as: Custom Point implementation. (Stores an arbitrary list of numbers as a Vector.)

      package my3D.geometry {
           public class Point {
                // Properties
                private var vector:Vector;
                
                // Constructor
                public function Point(...args) {
                     vector = new Vector(args); //  <---- Here's where the compiler markes the error.
                }
           }
      }
      

       

      As I said at the beginning, the compiler gives me the following error: Multiple markers at this line: -1137: Incorrect number of arguments. Expected no more than 0.  I do not understand why I am getting this error.  I am still new to ActionScript/Flex.  I am more familiar with languages like C# and Java...so go easy on the explanations.  Thanks.