flash on 2009-10-29
♥0 |
Line 42 |
Modified 2009-10-29 12:34:36 |
MIT License
archived:2017-03-20 07:40:55
ActionScript3 source code
/**
* Copyright pasodania ( http://wonderfl.net/user/pasodania )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/ri4w
*/
package {
import flash.display.Sprite;
import flash.filters.GlowFilter;
import flash.display.BitmapData;
import flash.display.Bitmap;
import flash.text.TextField;
import flash.events.*;
public class FlashTest extends Sprite {
public var txt:TextField;
public var bd:BitmapData;
private var bmp:Bitmap;
private var rt:int;
public function FlashTest() {
// write as3 code here..
txt = new TextField();
txt.height = txt.width = 100;
txt.border = true;
txt.multiline = true;
txt.type = "input";
txt.text = "abc\nxczx";
addChild(txt);
txt.appendText(txt.textHeight.toString());
bd = new BitmapData(101, 101);
bd.draw(txt);
bmp = new Bitmap(bd);
addChild(bmp);
bmp.x = bmp.y = 110;
bmp.filters = [new GlowFilter(0x000000, 1, 8, 8, 16, 1)];
rt = 0;
txt.addEventListener(Event.CHANGE, function(e:Event):void{
bd.dispose();
bd = new BitmapData(101, 101);
bd.draw(txt);
bmp = new Bitmap(bd);
bmp.x = bmp.y = 110;
addChild(bmp);
bmp.filters = [new GlowFilter(0x000000, 1, 8, 8, 16, 1)];
rt++;
bmp.rotation = rt;
});
}
}
}