もふもふ♥
//////////////////////////////////////////////////////////////////////////////
もふもふ♥
クリックすると、ひたすら「もふもふ♥」と表示される、それだけのスクリプト
//////////////////////////////////////////////////////////////////////////////
/**
* Copyright ProjectNya ( http://wonderfl.net/user/ProjectNya )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/260M
*/
////////////////////////////////////////////////////////////////////////////////
// もふもふ♥
// クリックすると、ひたすら「もふもふ♥」と表示される、それだけのスクリプト
////////////////////////////////////////////////////////////////////////////////
package {
import flash.display.Sprite;
import flash.display.StageScaleMode;
import flash.display.StageAlign;
import flash.events.Event;
import flash.events.MouseEvent;
[SWF(backgroundColor="#FFFFFF", width="465", height="465", frameRate="30")]
public class Main extends Sprite {
private var label:Label;
private static var heart:String = String.fromCharCode(9829);
public function Main() {
//Wonderfl.capture_delay(1);
init();
}
private function init():void {
label = new Label(465, 14);
addChild(label);
label.text = "もふもふ" + heart;
label.textColor = 0xFF6699;
//addEventListener(Event.ENTER_FRAME, update, false, 0, true);
stage.addEventListener(MouseEvent.CLICK, click, false, 0, true);
}
private function click(evt:MouseEvent):void {
label.update();
}
}
}
import flash.display.Sprite;
import flash.text.TextField;
import flash.text.TextFieldType;
import flash.text.TextFieldAutoSize;
import flash.text.AntiAliasType;
import flash.text.TextFormat;
import flash.text.TextFormatAlign;
class Label extends Sprite {
private var txt:TextField;
private static var fontType:String = "_ゴシック";
private var txtWidth:uint;
private var fontSize:uint;
private static var heart:String = String.fromCharCode(9829);
public function Label(w:uint, s:uint) {
txtWidth = w;
fontSize = s;
draw();
}
private function draw():void {
txt = new TextField();
txt.width = txtWidth;
addChild(txt);
txt.autoSize = TextFieldAutoSize.CENTER;
txt.type = TextFieldType.DYNAMIC;
txt.selectable = false;
//txt.embedFonts = true;
//txt.antiAliasType = AntiAliasType.ADVANCED;
txt.multiline = true;
txt.wordWrap = true;
var tf:TextFormat = new TextFormat();
tf.font = fontType;
tf.size = fontSize;
tf.align = TextFormatAlign.LEFT;
txt.defaultTextFormat = tf;
}
public function set text(param:String):void {
txt.text = param;
}
public function set textColor(param:uint):void {
txt.textColor = param;
}
public function update():void {
txt.appendText("もふもふ" + heart);
}
}