Hannan-ja-Esan-haat.20100822.131652.703Kuortti.2010-06-26Naginata
Helsinki
2010-02-07
09Kobujutsu
Stadion
2011-12-17
2italia2005-05_131Osaka,
Japan
2010-04-29Saaristoleiri
2009-08
34Kyoto
2011-05-04
Shimogamo
Jinja,
Jikishinkageryu
NaginatajutsuKobe,
Japan
2010-04-28Kyoto
2011-05-04
Shimogamo
Jinja,
Ryukyu
Kobujutsu
- Bo
kumiteSlovenija
2010-11Pakkas03Pitkanen_076Nanbudo_Norge2007-12_038Oslo
2010-12-03Somero2002_02Slovenia2009-04_658Nanbudo_Norge2007-12_211Hannan-ja-Esan-haat.20100821.180134.503Jikishinkageryu
Naginatajutsu
in Hyogo
Kenritsu
Budokan,
Himeji
2011-05-29Need for
umbrella
in Kobe
2011-06-10norge5oslo_169Inujima,
Japan
2010-04-30
Alcohol prep pad

A preparation pad moisturised with alcohol for cleaning the wheel brakes of a bicycle while installing new brake pads.

TextField autosizing options

Actionscript 3 in Flash player 9 has four different ways to automate the sizing of a text field depending of its contents. The following piece of code shows how each of these "TextFieldAutoSize" constants differ when set prior of setting the content of the text field.

The other constants tested here, the "TextFormatAlign", have no effect if the autosize is other than "none".

package {
    import flash.display.*;
    import flash.events.Event;
    import flash.text.*;

    [SWF( backgroundColor = '0x5B5B5B', frameRate = '33', width = '600', height = '400')]

    public class TextAutoSizing extends Sprite {
        private var median:Shape;

        private var autosizes:Array = [
            TextFieldAutoSize.CENTER,
            TextFieldAutoSize.LEFT,
            TextFieldAutoSize.NONE,
            TextFieldAutoSize.RIGHT
        ];

        private var alings:Array = [
            TextFormatAlign.CENTER,
            TextFormatAlign.JUSTIFY,
            TextFormatAlign.LEFT,
            TextFormatAlign.RIGHT
        ];

        public function TextAutoSizing() {
            stage.align = StageAlign.TOP_LEFT;
            stage.scaleMode = StageScaleMode.NO_SCALE;
            stage.quality = StageQuality.MEDIUM;
            this.loaderInfo.addEventListener(Event.INIT, init);
        }

        private function init(evt:Event):void {
            median = new Shape();
            median.x = stage.stageWidth / 2;
            addChild(median);

            var gra:Graphics = median.graphics;
            gra.lineStyle(2, 0x0066FF);
            gra.lineTo(0, stage.stageHeight);

            var k:uint = 0;
            for (var i:uint = 0; i < autosizes.length; i++) {
                for (var j:uint = 0; j < alings.length; j++) {
                    var field:TextField = createTextField(autosizes[i], alings[j]);
                    field.y = 24 * (k) + 10;
                    field.text = "This text field has autosize: " + field.autoSize + " and align: " + field.defaultTextFormat.align + ".";
                    addChild(field);
                    ++k;
                }
            }
        }

        private function createTextField(auto:String, align:String):TextField {
            var format:TextFormat = new TextFormat();
            format.align = align;
            format.color = 0x000000;
            format.size = 12;

            var field:TextField = new TextField();
            field.background = true;
            field.backgroundColor = 0xFFFFFF;
            field.border = true;
            field.borderColor = 0x000000;
            field.autoSize = auto;
            field.defaultTextFormat = format;
            field.type = TextFieldType.INPUT;
            field.x = median.x;
            return field;
        }
    }
}

The attached swf file is the output of the code.

TextAutoSizing.swf

Time: 23/12/2008 21:06

QR code for paazio.nanbudo.fi