我是AS3的新手,我非常感谢你能给我的任何帮助!我正在尝试创建一个按钮。但是,FlashDevelop一直告诉我我的语法错误:
以下是我的代码:
package
{
import flash.display.Sprite;
import flash.events.Event;
import flash.display.Graphics;
import flash.
/**
* ...
* @author 15leungjs1
*/
public class Main extends Sprite
{
private var button:Sprite;
public function Main():void
{
//Create a new instance of a Sprite to act as the button graphic.
button = new Sprite();
//Set the color of the button graphic
button.graphics.beginFill(0xFFAD3B);
//Set the X,Y, Width, and Height of the button graphic
button.graphics.drawRect(10, 0, 200, 100);
//Apply the fill
button.graphics.endFill();
//Add Handcursor,buttonMode, and mouseChildren
button.buttonMode = true;
button.useHandCursor = true;
button.mouseChildren = false;
//Add Button Sprite to stage
this.addChild(button);
}
}
}
}
答案 0 :(得分:2)
问题很简单......
您有以下代码行(第6行)未正确完成:
import flash.
您需要完成该导入语句或将其完全删除。