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: Practice04 - circular arrangement

Get Adobe Flash player
by Fumio.Nakayama 17 Apr 2012
    Embed
/**
 * Copyright Fumio.Nakayama ( http://wonderfl.net/user/Fumio.Nakayama )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/cdek
 */

// forked from tspringk's Practice04 - circular arrangement
// forked from tspringk's Practice 01
package {
    import flash.text.TextFormat;
    import flash.text.TextField;
    import flash.display.MovieClip;
    import flash.display.Sprite;
    import flash.events.*;
        
    public class practice01 extends MovieClip {
        
        private const CENTERX:int = 200;
        private const CENTERY:int = 200;
        private var rad:int = 100;
        private var num_array:Array = [1,2,3,4,5,6,7,8,9,10,11,12];
 

        public function practice01() {            

            for(var i:int = 0;i<num_array.length;i++) {
                var text_field:TextField = new TextField();
                var text_format:TextFormat = new TextFormat();
                var radian:Number = (i-2) / num_array.length * 2 * Math.PI;
                text_format.size = 20;
                text_format.color = 0xff0000;
                text_field.rotationX = 90;
                text_field.defaultTextFormat = text_format;
                text_field.text = num_array[i];
                text_field.x = rad * Math.cos(radian) + CENTERX;
                text_field.y = rad * Math.sin(radian) + CENTERY;
                this.addChild(text_field);
                var text_mc:MovieClip=new MovieClip();
                text_field.addEventListener(Event.ENTER_FRAME, loop);
            }
        }
        
        private function loop(e:Event) : void {
            e.target.rotationX += 5;
        }

    }
}