我想知道如何将参数传递给链接到按钮的外部动作脚本文件中的函数。在上面的代码中,当我单击按钮时,出现以下错误。我认为我将值传递给函数的方式存在问题。请帮忙。
ArgumentError: Error #1063: Argument count mismatch on Node(). Expected 1, got 0.
at flash.display::Sprite/constructChildren()
at flash.display::Sprite()
at flash.display::MovieClip()
package
{
import flash.display.MovieClip;
import flash.events.*;
import flash.display.SimpleButton;
public class Node extends SimpleButton
{
public var left:Node; // left child
public var right:Node; // right child
public var value:int = int.MAX_VALUE; // value in node
public var test:int;
public function Node(c:int):void
{
value = c;
addEventListener(MouseEvent.CLICK, AddClick);
}
public function AddClick(e:Event):void
{
Node(25);
trace(value);
}
}//class
}//package