参数计数不匹配(不是事件相关)

时间:2013-07-29 16:35:58

标签: actionscript-3 flash arguments flash-cs6

我收到此错误,但我的功能应该接受6个参数?!? 有谁知道可能会发生什么?

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]

这是函数签名

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 {
            ...
        }

为了简化,这里大概是发生了什么......

ubButtonSimple采用了这个数组:

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"]];

然后调用

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

1 个答案:

答案 0 :(得分:0)

我只计算你的创建函数中的5个参数