Search code examples
actionscript-3flashargumentsflash-cs6

Argument Count Mismatch (Not Event Related)


I'm getting this error but my function is supposed to accept 6 parameters?!? Does anyone have any idea what might be happening?

Starting Test
ArgumentError: Error #1063: Argument count mismatch on edu.clips2.movieclip::ubContainerSimple$/create(). Expected 1, got 6.
    at Function/http://adobe.com/AS3/2006/builtin::apply()
    at edu.clips2.ui::ubButtonSimple$/create()[/Volumes/Work/CLIPS Repo/classes/as3/edu/clips2/ui/ubButtonSimple.as:79]
    at edu.ewins.wrapper::ActivityHelpingHandButton()[/Volumes/Work/CLIPS Repo/classes/as3/edu/ewins/wrapper/ActivityHelpingHandButton.as:34]
    at edu.ewins.wrapper::ActivityHelpingHandButton$/create()[/Volumes/Work/CLIPS Repo/classes/as3/edu/ewins/wrapper/ActivityHelpingHandButton.as:52]
    at test::AS3Test/init()[/Volumes/Work/CLIPS Repo/classes/as3/test/AS3Test.as:67]
    at test::AS3Test()[/Volumes/Work/CLIPS Repo/classes/as3/test/AS3Test.as:63]

Here is the function signature

package edu.clips2.movieclip {
    ...
    public class ubContainerSimple {
        ...
        public static function create(parent:DisplayObjectContainer, instanceName:String= null, depth:Number=-1, mcProps:Object=null, linkageName:String= null):MovieClip {
            ...
        }

For simplification here is approximately what was happening...

ubButtonSimple took this array:

var a:Array = [ubContainerSimple, [target, "foregroundContainer", 6, {x:0, y:0}, {alpha:1, rotation:0, scaleX:0.4, scaleY:0.4, x:6, y:11}, "HelpingHand"]];

and then called

a[0].create.apply(null, a[1]);

Solution

  • I only count 5 parameters in your create function