0

I encountered an error in Flash CS5.5 ( ActionScript 3 ) :

ArgumentError: Error #1063: Argument count mismatch on MethodInfo-185(). Expected 1, got 0. at MethodInfo-186()

But I have no MethodInfo-185() and MethodInfo-186() . What's wrong with the Flash ?

4

2 に答える 2

0

Somehow Flash CS5.5 / AS3 compiler cannot identify nested functions. The compiler will refer nested functions ( myInnerFunction as example below ) as MethodInfo-123() ( or something similar ).

function myFunction() {
  function myInnerFunction() {
  }
}
于 2012-09-19T09:42:13.477 に答える
0

This means yes, you have there an unnamed function. Make sure you have all event listeners enumerated, and check if you have a listener added like this:

addEventListener(Event.ENTER_FRAME,function():void {...});

Any event can be in place of an enter frame event I wrote. If so, this is the line with an error. An event listener function should always accept 1 parameter of corresponding Event type. In this case, the correct line should be:

addEventListener(Event.ENTER_FRAME,function(e:Event):void {...});

Note the parameter type. If you, for example, listen for a "click" mouse event, it should be of MouseEvent type instead.

于 2012-09-19T10:09:43.507 に答える