I'm new to AS3, and I would really appreciate any help you can give me! I am trying to create a button. However, FlashDevelop keeps telling me I have a Syntax Error in:
Below is my code:
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);
}
}
}
}
The problem is simple...
You have the following line of code (line 6) that is not finished correctly:
import flash.
You need to complete that import statement or remove it completely.