☆ボタン
押すとキラキラ星のオルゴールが流れます!!
キラキラ星のmp3ファイルはここからもらいました!! http://www.dream-orgel.net/diary.cgi
/**
* Copyright WinField95 ( http://wonderfl.net/user/WinField95 )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/qfxD
*/
package
{
import flash.display.Sprite;
import flash.text.TextField;
import flash.text.TextFormat;
import flash.display.SimpleButton;
import flash.events.MouseEvent;
import flash.display.Sprite;
import flash.media.Sound;
import flash.net.URLRequest;
public class Main extends Sprite
{
private var tf:TextField;
private var count:int = 0;
public function Main()
{
var up:State = new State(0x000000);
var over:State = new State(0xFFFFFF);
var down:State = new State(0x000000);
var button:SimpleButton = new SimpleButton(up, over, down, over);
//button.x = (stage.stageWidth - button.width) / 2;
//button.y = (stage.stageHeight - button.height) / 2;
button.x = 0;
button.y = 0;
button.addEventListener(MouseEvent.CLICK, onMouseClick);
addChild(button);
tf = new TextField();
tf.defaultTextFormat = new TextFormat("", 20, 0x0, true);
tf.autoSize = "left";
addChild(tf);
}
public var sound:Sound = new Sound(new URLRequest("http://www.dream-orgel.net/data/upfile/120-2.mp3"));
private function onMouseClick(event:MouseEvent):void
{
sound.play();
}
}
}
import flash.display.Sprite;
import flash.text.TextField;
import flash.text.TextFormat;
import flash.geom.Matrix;
import flash.display.BitmapData;
import flash.display.Sprite;
import flash.media.Sound;
class State extends Sprite
{
public function State(color:int)
{
//graphics.lineStyle(2.0, color);
var d:int = 30;
graphics.beginFill(0x000080);
graphics.drawRoundRect(d + 0,d + 0, d + 200, d + 200, 50);
graphics.endFill();
graphics.beginFill(0x00BFFF);
graphics.drawRoundRect(d + 5,d + 5,d + 190,d + 190, 40, 40);
graphics.endFill();
var matrix:Matrix = new Matrix();
matrix.createGradientBox(170,170,45 * Math.PI / 180, 10, 10);
graphics.beginGradientFill("linear", [0x00FFFF, 0x0000CD], [1.0, 1.0], [0, 255], matrix);
graphics.drawRoundRect(d + 8,d + 8,d + 184,d + 184, 30, 30);
graphics.endFill();
graphics.lineStyle(2.0, color);
graphics.beginFill(0x000080);
var vertices:Vector.<Number> = Vector.<Number>([d + 100, d + 120, d + 100,d + 200, d + 150,d + 160]);
graphics.drawTriangles(vertices);
graphics.endFill();
var tf:TextField = new TextField();
tf.defaultTextFormat = new TextFormat("_typeWriter", 40, color, true);
tf.text = "Start";
tf.autoSize = "left";
//tf.x = (this.width - tf.width) / 2;
//tf.y = (this.height - tf.height) / 2;
tf.x = d + 50;
tf.y = d + 50;
tf.selectable = false;
addChild(tf);
}
}