describeType Wonderfl
♥0 |
Line 49 |
Modified 2009-06-02 02:39:07 |
MIT License
archived:2017-03-20 16:25:29
ActionScript3 source code
/**
* Copyright onedayitwillmake ( http://wonderfl.net/user/onedayitwillmake )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/zUD6
*/
package
{
import flash.display.Sprite;
import flash.utils.describeType;
import flash.text.TextFormat;
import flash.text.TextFormatAlign;
public class FlashTest extends Sprite
{
public static var DETAIL_FORMAT :TextFormat
public function FlashTest()
{
setFormat();
var classInfo:DetailText = new DetailText(describeType(Wonderfl), DETAIL_FORMAT)
addChild(classInfo);
}
public static function setFormat():void
{
DETAIL_FORMAT = new TextFormat()
DETAIL_FORMAT.font = "Arial"
DETAIL_FORMAT.size = 12;
DETAIL_FORMAT.align = TextFormatAlign.LEFT;
DETAIL_FORMAT.color = 0x333333;
DETAIL_FORMAT.kerning = false;
}
}
}
import flash.display.Sprite;
import flash.text.TextField;
import flash.text.TextFormat;
import flash.text.TextFieldAutoSize;
import flash.text.AntiAliasType;
internal class DetailText extends Sprite
{
public var _textField :TextField;
private var _format :TextFormat;
public function DetailText(copy:XML, format:TextFormat)
{
_textField = new TextField();
_textField.defaultTextFormat = format;
_textField.embedFonts = false;
_textField.autoSize = TextFieldAutoSize.LEFT;
_textField.selectable = true;
_textField.antiAliasType = AntiAliasType.ADVANCED
_textField.text = copy;
_textField.sharpness = 0.05
_textField.thickness = 1
addChild(_textField)
}
}