今天学习了按钮的创建(纯代码):
package{ import flash.display.Sprite; import flash.display.Shape; import flash.display.SimpleButton; public class Main extends Sprite{ public function Main():void{
var a:Shape = new Shape(); a.graphics.beginFill(0x00ff00); a.graphics.drawCircle(0,0,25); a.graphics.endFill(); var b:Shape = new Shape(); b.graphics.beginFill(0x0000ff); b.graphics.drawCircle(0,0,25); b.graphics.endFill(); var c:Shape = new Shape(); c.graphics.beginFill(0xffff00); c.graphics.drawCircle(0,0,25); c.graphics.endFill(); var button:SimpleButton = new SimpleButton(a,b,c,c); button.x = button.y = 100; addChild(button); } } }
更多详情请点击 http://blog.sina.com.cn/zhaojianjunzjj