Actionscript 3 我的钮扣不见了

Actionscript 3 我的钮扣不见了,actionscript-3,Actionscript 3,我试图添加一个SimpleButton public class Main extends Sprite { public function Main():void { if (stage) init(); else addEventListener(Event.ADDED_TO_STAGE, init); } private function init(e:Event = null):void {

我试图添加一个
SimpleButton

public class Main extends Sprite 
{   
    public function Main():void 
    {
        if (stage) init();
        else addEventListener(Event.ADDED_TO_STAGE, init);
    }

    private function init(e:Event = null):void 
    {
        removeEventListener(Event.ADDED_TO_STAGE, init);
        // entry point

        var btn:SimpleButton = new SimpleButton();      
        this.addChild(btn);

但却无处可寻。有什么帮助吗?

SimpleButton需要在其构造函数中显示对象(例如精灵)。如果不指定任何内容,它将不会显示任何内容

从手册中:

SimpleButton(upState:DisplayObject = null, overState:DisplayObject = null, downState:DisplayObject = null, hitTestState:DisplayObject = null)

你试过为按钮设置x/y吗?是的,我试过:-)x=10,y=10