In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

forked from: FontLoaderを使ってMinimalCompsで日本語表示

MinimalCompsで日本語・改
fork元のやつは適当すぎたので、リテイクしました。
こっちがちゃんとしたやり方です。
ドキュメントもminimalなminimalcomps。
/**
 * Copyright Fake ( http://wonderfl.net/user/Fake )
 * GNU General Public License, v3 ( http://www.gnu.org/licenses/quick-guide-gplv3.html )
 * Downloaded from: http://wonderfl.net/c/lWFQ
 */

// forked from Fake's FontLoaderを使ってMinimalCompsで日本語表示
package {
    import flash.text.TextFormat;
    import flash.events.Event;
    import flash.display.Sprite;
    import com.bit101.components.Text;
    import net.wonderfl.utils.FontLoader;
    import com.bit101.components.Style;
    import com.bit101.components.PushButton;

    public class FlashTest extends Sprite {
        private var fontname:String = "Aqua";
        private var debugout:Text;

        public function FlashTest() {
            // write as3 code here..
            var floader:FontLoader = new FontLoader();
            floader.addEventListener(Event.COMPLETE, function (e:Event):void {
                //debugout.textField.defaultTextFormat = new TextFormat(fontname, 12);
                Style.embedFonts = true;
                Style.fontName = fontname
                Style.fontSize = 12;
                debugout = new Text(parent, 50, 50, "Now loading...");
                debugout.text = "こんなやり方で大丈夫か?\n";
                var btn:PushButton = new PushButton(parent, 50, 180, "大丈夫だ、問題ない");
                btn.setSize(150, 20);
                var btn2:PushButton = new PushButton(parent, 50, 220, "一番いいフォントを頼む");
                btn2.setSize(150, 20);
            });
            floader.load(fontname);
        }
    }
}