もふもふ
//////////////////////////////////////////////////////////////////////////////
もふもふ
クリックすると、ひたすら「もふもふ」と表示される、それだけのスクリプト
//////////////////////////////////////////////////////////////////////////////
/**
* Copyright ProjectNya ( http://wonderfl.net/user/ProjectNya )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/yEq6
*/
////////////////////////////////////////////////////////////////////////////////
// もふもふ
// クリックすると、ひたすら「もふもふ」と表示される、それだけのスクリプト
////////////////////////////////////////////////////////////////////////////////
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;
public function Main() {
//Wonderfl.capture_delay(1);
init();
}
private function init():void {
label = new Label(465, 14);
addChild(label);
label.text = "もふもふ";
//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;
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("もふもふ");
}
}