<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" xml:lang="en-US">
  <title>theRemix - Home</title>
  <id>tag:remixtechnology.com,2009:mephisto/</id>
  <generator version="0.8.0" uri="http://mephistoblog.com">Mephisto Drax</generator>
  
  <link href="http://remixtechnology.com/" rel="alternate" type="text/html" />
  <updated>2009-10-11T23:45:21Z</updated>
  <link rel="self" href="http://feeds.feedburner.com/RemixTechnologyFeed" type="application/atom+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><entry xml:base="http://remixtechnology.com/">
    <author>
      <name>theRemix</name>
    </author>
    <id>tag:remixtechnology.com,2009-10-10:45390</id>
    <published>2009-10-10T03:29:00Z</published>
    <updated>2009-10-11T23:45:21Z</updated>
    <category term="haXe Projects" />
    <category term="actionscript3" />
    <category term="haxe" />
    <category term="source" />
    <category term="toy" />
    <link href="http://feedproxy.google.com/~r/RemixTechnologyFeed/~3/He51MbTO2Rw/gravity-haxe" rel="alternate" type="text/html" />
    <title>theRemix invents gravity in haXe (with full source)</title>
<summary type="html">&lt;p&gt;I created an experiment to visualize and play with the law of gravity.&lt;br /&gt;
The concept of gravity is new, i just created it, attraction occurs between any two masses in space.&lt;br /&gt;
I came up with the formula for gravity:&lt;br /&gt;
&lt;span&gt;Mass1 &amp;times; Mass2&lt;/span&gt;&lt;br /&gt;
 Distance&amp;sup2;&lt;/p&gt;

&lt;p&gt;neat huh?&lt;/p&gt;

&lt;p&gt;check out the full &lt;a href="/tags/haXe"&gt;haXe&lt;/a&gt; source code and &lt;a href="/view/Gravity-haXe"&gt;play with gravity to create orbits&lt;/a&gt; in the &lt;a href="/view/Gravity-haXe"&gt;full article&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="/view/Gravity-haXe"&gt;&lt;/a&gt;&lt;/p&gt;</summary><content type="html">
            &lt;p&gt;I created an experiment to visualize and play with the law of gravity.&lt;br /&gt;
The concept of gravity is new, i just created it, attraction occurs between any two masses in space.&lt;br /&gt;
I came up with the formula for gravity:&lt;br /&gt;
&lt;span&gt;Mass1 &amp;times; Mass2&lt;/span&gt;&lt;br /&gt;
 Distance&amp;sup2;&lt;/p&gt;

&lt;p&gt;neat huh?&lt;/p&gt;

&lt;p&gt;check out the full &lt;a href="/tags/haXe"&gt;haXe&lt;/a&gt; source code and &lt;a href="/view/Gravity-haXe"&gt;play with gravity to create orbits&lt;/a&gt; in the &lt;a href="/view/Gravity-haXe"&gt;full article&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="/view/Gravity-haXe"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;ok maybe it’s not that new, and maybe i didn’t invent gravity, though usually where you see it in flash, you’ll see the force only applied in the downwards direction. Many thanks to Chris Sass for helping make sure i don’t waste &gt;1 hour on figuring out acceleration and stuff.&lt;/p&gt;

&lt;h2&gt;Play&lt;/h2&gt;

&lt;p&gt;drag an object (they actually represent cookies) around with your mouse, clicking them makes them dark and stationary… like stale cookies, no one wants that. pressing any key will reset the objects to random positions.&lt;br /&gt;
&lt;strong&gt;see if you can create a stable orbit.&lt;/strong&gt;&lt;br /&gt;
&lt;em&gt;hint, gravity is stronger when the objects are closer, have one object moving towards the other, then move it out of the way before impact&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;

You need &lt;a href="http://get.adobe.com/flashplayer/" title="Get Flash"&gt;Flash 10&lt;/a&gt; to view the awesome. It’s a free and fast upgrade.
&lt;/p&gt;  

&lt;h2&gt;Source&lt;/h2&gt;

&lt;h3&gt;build.hx&lt;/h3&gt;




    #build file
    –flash-strict
    # uncomment for better debugging
    –no-inline
    -swf-version 9
    # the color of space is 0xEFEFEF i shit you not
    -swf-header 600:500:30:EFEFEF
    -cp src
    -main Gravity
    -swf deploy/out.swf


&lt;h3&gt;Gravity.hx&lt;/h3&gt;




/*
        Force of Gravity = (Mass1 * Mass2) / distance^2
*/
    import com.remixtechnology.Utils;
    import com.remixtechnology.ShadowedTextField;
    import flash.display.Stage;
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.Lib;
    import flash.geom.Point;
    import flash.events.KeyboardEvent;
    class Gravity
    {
        private var stage: Stage;
        private var b1: Ball;
        private var b2: Ball;
        private var b3: Ball;
        private var lines_canvas: Sprite;

        private static inline var line_thickness:Float = 1;
        private static inline var line_color:UInt = 0x666666;
        private static inline var line_alpha:Float = .6;

        public function new()
        {
            stage = Lib.current.stage;

            // fun fact, planet haXe is only 2400 grams
            b1 = new Ball(2400);
            stage.addChild(b1);

            // a cookie orbits planet haXe
            b2 = new Ball(400);
            stage.addChild(b2);

/*          // Don’t play with my emotions
            b3 = new Ball(1200);
            stage.addChild(b3);*/

            randomReset();

            lines_canvas = new Sprite();
            lines_canvas.mouseChildren = lines_canvas.mouseEnabled = false;
            stage.addChild(lines_canvas);

            stage.addEventListener(Event.ENTER_FRAME, loop);
            stage.addEventListener(KeyboardEvent.KEY_DOWN, randomReset);
        }

        private inline function randomReset( ?_ ):Void
        {
            b1.x = Std.random(stage.stageWidth);
            b1.y = Std.random(stage.stageHeight);
            b2.x = Std.random(stage.stageWidth);
            b2.y = Std.random(stage.stageHeight);
/*          b3.x = Std.random(stage.stageWidth);
            b3.y = Std.random(stage.stageHeight);*/

            // netForce doesn’t really need to be reset, unless you want a threesome
            b1.vx = b1.vy = b1.netRadian = b1.netForce = 
            b2.vx = b2.vy = b2.netRadian = b2.netForce = 
/*          b3.vx = b3.vy = b3.netRadian = b3.netForce = */ 0;
        }

        private inline function loop( _ ):Void
        {
            lines_canvas.graphics.clear();
            Utils.filicide(lines_canvas);
            law(b1,b2);
            // the only way you’ll ever experience a threeway, and it still doesn’t work :/
/*          law(b2,b3);
            law(b3,b1)*/
        }

        private inline function law( b1:Ball, b2:Ball ): Void
        {
            // Force of Gravity = (Mass1 * Mass2) / distance^2
            var force:Float = (b1.mass * b2.mass) / Math.pow(Point.distance(b1.point,b2.point), 2);

            var totalMass:Float = b1.mass + b2.mass;

            var yDistance:Float = b2.y - b1.y;
            var xDistance:Float = b2.x - b1.x;
            var totalDistance:Float = Math.sqrt(Math.pow(yDistance,2) + Math.pow(xDistance,2));

            if (Point.distance(b1.point,b2.point) &gt;= b1.radius + b2.radius)
            {
                // gravitate ball1 to ball2
                b1.addForce(Math.atan2(yDistance, xDistance), force);

                // gravitate ball1 to ball2
                b2.addForce(Math.atan2(-yDistance, -xDistance), force);

            }

            // make pretty
            lines_canvas.graphics.lineStyle(line_thickness, line_color, line_alpha);
            lines_canvas.graphics.moveTo(b1.x,b1.y);
            lines_canvas.graphics.lineTo(b2.x,b2.y);
            var force_label = new ShadowedTextField(“Net Force: ” + Std.string(Utils.round(force,2)) + “\nDistance: ” + Std.string(Utils.round(totalDistance,2)));
            force_label.setColor(0x999999);
            force_label.setShadowColor(0x333366);
            force_label.bold(false);
            var mid:Point = Point.interpolate(b1.point,b2.point,.5);
            force_label.x = mid.x;
            force_label.y = mid.y;
            lines_canvas.addChild(force_label);
        }

        public static function main(): Void
        {
            var m: Gravity = new Gravity();
        }
    }


&lt;h3&gt;Ball.hx&lt;/h3&gt;




    import flash.display.Sprite;
    import flash.geom.Point;
    import flash.events.Event;
    import flash.events.MouseEvent;
    import com.remixtechnology.Utils;
    import com.remixtechnology.Draggable;
    import com.remixtechnology.ShadowedTextField;

    class Ball extends Sprite
    {
        public var mass: Float;
        public var point(getPoint,null): Point;
        public var radius: Float; // girth
        public var netRadian: Float; // angle of movement in radians
        public var netForce: Float; // here for when i unsucessfully added another gravitational object
        private var xForce: Float;
        private var yForce: Float;
        private var ax: Float; // accelerate to glory!
        private var ay: Float;
        public var vx: Float; //  velocity 
        public var vy: Float;
        public var totalSpeed(getTotalSpeed,null): Float; // PA, pythagoreanonymous
        private var locked: Bool; // because this ball could be orbiting a much more massive cookie 

        private var speed_label: ShadowedTextField; // mass and speed

        private static inline var color:UInt = 0x3399FF; // FYI my eyes are this color
        private static inline var locked_color:UInt = 0x3344CC;
        private static inline var border_color:UInt = 0x3366ff;
        private static inline var border_thickness:Float = 2;
        private static inline var radius2mass:Float = .02; // radius = this*mass

        public function new( _mass:Float )
        {
            super();
            mass = _mass;
            radius = mass*radius2mass;
            graphics.lineStyle(border_thickness, border_color);
            graphics.beginFill(color);
            graphics.drawCircle(0,0,radius);
            graphics.endFill();

            xForce = 0;
            yForce = 0;

            netForce = 0;
            netRadian = 0;

            vx = 0;
            vy = 0;

            locked = false;

            new Draggable(this);

            speed_label = new ShadowedTextField(“Speed: ” + Std.string(totalSpeed));
            speed_label.mouseChildren = false;
            speed_label.setColor(0x887766);
            speed_label.setShadowColor(0x121212);
            speed_label.bold(false);
            addChild(speed_label);

            addEventListener(Event.ENTER_FRAME, loop);
            addEventListener(MouseEvent.MOUSE_UP, mouseUp);
            addEventListener(MouseEvent.CLICK, lock);
        }
        private inline function loop( _ ):Void
        {
            xForce = Math.cos(netRadian) * netForce;
            yForce = Math.sin(netRadian) * netForce;
            ax = xForce / mass;
            ay = yForce / mass;

            if(!locked){
                vx += ax;
                vy += ay;       
                x += vx;
                y += vy;
            }

            speed_label.setText(“Mass: ” + Std.string(mass) + “\nSpeed: ” + Std.string(Utils.round(totalSpeed,2)));
        }
    /*  // go ahead and do it, i dare you…
        public inline function launch(  ): Void
        {
            vx = Std.random( 10 ) - 5;
            vy = Std.random( 10 ) - 5;
        }*/
        public inline function addForce( radian:Float, force:Float ): Void
        {
            var rad = (netRadian + radian) / 2;
            netRadian = (rad &gt; 0)? rad : rad ;
            netForce = (netForce - force) / -2;
        }

        private inline function getPoint(  ):Point{ return new Point(x,y); }
        public inline function getTotalSpeed(  ): Float
        {
            return Math.sqrt(Math.pow(vx,2) + Math.pow(vy,2));
        }

        private inline function mouseUp( _ ):Void
        {
            vx = 0;
            vy = 0;
        }
        private inline function lock( _ ):Void
        {
            locked = !locked;

            graphics.clear();
            graphics.lineStyle(border_thickness, border_color);
            if(locked){
                graphics.beginFill(locked_color);
                graphics.drawCircle(0,0,radius);
                graphics.endFill();
            }else{
                graphics.beginFill(color);
                graphics.drawCircle(0,0,radius);
                graphics.endFill();
            }
        }
    }


&lt;h3&gt;com.remixtechnology.Utils.hx&lt;/h3&gt;




    package com.remixtechnology;
    class Utils{

        public static inline function round( num:Float, places:Int=0 ): Float
        {
            places *= 10;
            var out:Float = num * places;
            out = Math.round(out);
            out = out / places;
                    return out;
        }

    }


&lt;h3&gt;com.remixtechnology.Draggable.hx&lt;/h3&gt;




    package com.remixtechnology;
    import flash.events.Event;
    import flash.events.MouseEvent;
    import flash.display.DisplayObject;
    class Draggable{
        private var x_offset: Float;
        private var y_offset: Float;
        public var enableDrag: Bool;
        public var displayObject: DisplayObject;
        public function new(d:DisplayObject){
            displayObject = d;
            displayObject.addEventListener(MouseEvent.MOUSE_DOWN, mouse_down);
            displayObject.addEventListener(MouseEvent.MOUSE_UP, mouse_up);
            enableDrag = true;
        }
        private inline function mouse_down( event:MouseEvent ):Void
        {
            displayObject.addEventListener(Event.ENTER_FRAME, enterFrame);
            displayObject.stage.addEventListener(MouseEvent.MOUSE_UP, mouse_up);
            x_offset = displayObject.mouseX;
            y_offset = displayObject.mouseY;
        }
        private function mouse_up( _ ):Void
        {
            displayObject.removeEventListener(Event.ENTER_FRAME, enterFrame);
        }
        private inline function enterFrame( _ ):Void
        {
            if(enableDrag){
                displayObject.x = displayObject.stage.mouseX - x_offset;
                displayObject.y = displayObject.stage.mouseY - y_offset;
            }
        }
    }


&lt;h3&gt;com.remixtechnology.ShadowedTextField.hx&lt;/h3&gt;




    package com.remixtechnology;

    import flash.display.Sprite;
    import flash.text.TextField;
    import flash.text.TextFieldAutoSize;
    import flash.text.TextFormat;
    import flash.text.AntiAliasType;

    class ShadowedTextField extends Sprite
    {

        private var fgColor:UInt;
        private var bgColor:UInt;
        private var xoff:Float;
        private var yoff:Float;

        private var tfFore:TextField;
        private var tfBack:TextField;
        private var fmtFore:TextFormat;
        private var fmtBack:TextFormat;

        private var size:Int;
        private var font:String;

        public function new( ?text:String )
        {
            bgColor = 0x000000;
            fgColor = 0xFFCC00;
            xoff = 1;
            yoff = 1;
            size = 14;
            font = ‘Verdana’;

            mouseChildren = false;
            mouseEnabled = false;

            tfBack = new TextField();
            tfBack.autoSize = TextFieldAutoSize.LEFT;
            tfBack.selectable = false;
            tfBack.x = xoff;
            tfBack.y = yoff;
            addChild(tfBack);

            tfFore = new TextField();
            tfFore.autoSize = TextFieldAutoSize.LEFT;
            tfFore.selectable = false;
            addChild(tfFore);

            fmtFore = new TextFormat();
            fmtFore.color = fgColor;
            fmtFore.size = size;
            fmtFore.font = font;
            fmtFore.bold = true;

            fmtBack = new TextFormat();
            fmtBack.color = bgColor;
            fmtBack.size = size;
            fmtBack.font = font;
            fmtBack.bold = true;

            if(text != null) setText(text);

            super();
        }

        public inline function setText(n:String):Void
        {
            tfFore.text = n;
            tfFore.setTextFormat(fmtFore);

            tfBack.text = n;
            tfBack.setTextFormat(fmtBack);
        }

        public inline function appendText(n:String):Void
        {
            tfFore.appendText(“\n” + n);
            tfFore.setTextFormat(fmtFore);

            tfBack.appendText(“\n” + n);
            tfBack.setTextFormat(fmtBack);
        }

        public inline function setColor(color:UInt):Void
        {
            fmtFore.color = color;
            tfFore.setTextFormat(fmtFore);
        }

        public inline function setShadowColor(color:UInt):Void
        {
            fmtBack.color = color;
            tfBack.setTextFormat(fmtBack);
        }

        public inline function setSize(size:Int):Void{
            fmtFore.size = size;
            tfFore.setTextFormat(fmtFore);

            fmtBack.size = size;
            tfBack.setTextFormat(fmtBack);
        }

        public inline function bold(b:Bool):Void{
            if(b){
                fmtFore.bold = true;
                fmtBack.bold = true;
            }else{
                fmtFore.bold = false;
                fmtBack.bold = false;
            }
        }

    }

          &lt;img src="http://feeds.feedburner.com/~r/RemixTechnologyFeed/~4/He51MbTO2Rw" height="1" width="1"/&gt;</content>  <feedburner:origLink>http://remixtechnology.com/view/gravity-haxe</feedburner:origLink></entry>
  <entry xml:base="http://remixtechnology.com/">
    <author>
      <name>theRemix</name>
    </author>
    <id>tag:remixtechnology.com,2009-09-24:45386</id>
    <published>2009-09-24T04:22:00Z</published>
    <updated>2009-09-24T04:23:35Z</updated>
    <category term="haXe Projects" />
    <category term="flash" />
    <category term="game" />
    <category term="haxe" />
    <link href="http://feedproxy.google.com/~r/RemixTechnologyFeed/~3/fVBrHm4y7Y0/new-flash-game-polyn" rel="alternate" type="text/html" />
    <title>New flash game Polyn</title>
<content type="html">
            &lt;p&gt;Haven’t posted anything in a while, probably cause i’ve been busy developing my entry for the &lt;a href="http://www.mochimedia.com/contest/may09"&gt;Mochi May 09 “Word Play” contest&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Our entry has been submitted, click on the bee to &lt;a href="http://playpolyn.com"&gt;play Polyn&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://playpolyn.com"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Game designed and illustrated by &lt;a href="http://pnpnt.com"&gt;Kelli Harada pnpnt.com&lt;/a&gt;&lt;br /&gt;
Game developed by me, on about 60 bus rides&lt;br /&gt;
Site designed by &lt;a href="http://pnpnt.com"&gt;Kelli Harada pnpnt.com&lt;/a&gt;&lt;br /&gt;
Site html5’d by me&lt;/p&gt;

&lt;p&gt;built with my favorite swf compiler &lt;a href="/tags/haXe"&gt;haXe&lt;/a&gt;&lt;/p&gt;
          &lt;img src="http://feeds.feedburner.com/~r/RemixTechnologyFeed/~4/fVBrHm4y7Y0" height="1" width="1"/&gt;</content>  <feedburner:origLink>http://remixtechnology.com/view/new-flash-game-polyn</feedburner:origLink></entry>
  <entry xml:base="http://remixtechnology.com/">
    <author>
      <name>theRemix</name>
    </author>
    <id>tag:remixtechnology.com,2009-08-23:45380</id>
    <published>2009-08-23T13:18:00Z</published>
    <updated>2009-09-29T04:47:59Z</updated>
    <category term="haXe Projects" />
    <category term="actionscript3" />
    <category term="haxe" />
    <category term="source" />
    <category term="tutorial" />
    <link href="http://feedproxy.google.com/~r/RemixTechnologyFeed/~3/MUX-7BUHIdU/haxe_stopwatch" rel="alternate" type="text/html" />
    <title>StopWatch class - code snippet</title>
<summary type="html">&lt;p&gt;a simple StopWatch class to measure how long something takes.&lt;/p&gt;



&lt;p&gt;&lt;a href="/view/haXe_stopWatch"&gt;read full article and see source code&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;also on &lt;a href="http://haxe.org/doc/snip/StopWatch"&gt;http://haxe.org/doc/snip/StopWatch&lt;/a&gt;&lt;/p&gt;</summary><content type="html">
            &lt;p&gt;a simple StopWatch class to measure how long something takes.&lt;/p&gt;



&lt;p&gt;&lt;a href="/view/haXe_stopWatch"&gt;read full article and see source code&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;also on &lt;a href="http://haxe.org/doc/snip/StopWatch"&gt;http://haxe.org/doc/snip/StopWatch&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;a simple StopWatch to measure how long something takes.&lt;/p&gt;

&lt;h2&gt;Usage&lt;/h2&gt;



&lt;h2&gt;Source&lt;/h2&gt;

&lt;h3&gt;StopWatch.hx&lt;/h3&gt;


          &lt;img src="http://feeds.feedburner.com/~r/RemixTechnologyFeed/~4/MUX-7BUHIdU" height="1" width="1"/&gt;</content>  <feedburner:origLink>http://remixtechnology.com/view/haxe_stopwatch</feedburner:origLink></entry>
  <entry xml:base="http://remixtechnology.com/">
    <author>
      <name>theRemix</name>
    </author>
    <id>tag:remixtechnology.com,2009-08-23:45379</id>
    <published>2009-08-23T12:57:00Z</published>
    <updated>2009-08-23T13:02:05Z</updated>
    <category term="haXe Projects" />
    <category term="actionscript3" />
    <category term="haxe" />
    <category term="source" />
    <category term="tutorial" />
    <link href="http://feedproxy.google.com/~r/RemixTechnologyFeed/~3/x6DduItswDk/haxe_commaformat" rel="alternate" type="text/html" />
    <title>commaFormat(num:Float):String; code snippet</title>
<summary type="html">&lt;p&gt;added another code snippet to &lt;a href="http://haxe.org/doc/snip/commaFormat"&gt;http://haxe.org/doc/snip/commaFormat&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;that commafies a number such as really high scores &lt;/p&gt;

&lt;p&gt;converts 123456 to “123,456”
and 1234567890.12345 to “1,234,567,890.12345”&lt;/p&gt;

&lt;p&gt;&lt;a href="/view/haxe_commaformat"&gt;read full article and source&lt;/a&gt;&lt;/p&gt;</summary><content type="html">
            &lt;p&gt;added another code snippet to &lt;a href="http://haxe.org/doc/snip/commaFormat"&gt;http://haxe.org/doc/snip/commaFormat&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;that commafies a number such as really high scores &lt;/p&gt;

&lt;p&gt;converts 123456 to “123,456”
and 1234567890.12345 to “1,234,567,890.12345”&lt;/p&gt;

&lt;p&gt;&lt;a href="/view/haxe_commaformat"&gt;read full article and source&lt;/a&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;public static inline function commaFormat( num:Float ): String
    var str:String = Std.string(num);
        var str_ar:Array&amp;lt;String&amp;gt; = new Array&amp;lt;String&amp;gt;();
        var pos:Int = 1;
        var i:Int;
        var out:String = "";

        if (str.indexOf(".") == -1 ){
            str_ar = str.split("");
        }else{
            out = str.substr(str.indexOf("."));
            str_ar = str.substr(0, str.indexOf(".")).split("");
        }

        str_ar.reverse();
        for (i in 0...str_ar.length){
            out = str_ar[i]+out;
            if (pos++ == 3) {
                pos = 1;
                out = ((Math.isNaN(Std.parseFloat(str_ar[0])) &amp;amp;&amp;amp; i &amp;gt; 1) || (!Math.isNaN(Std.parseFloat(str_ar[0])) &amp;amp;&amp;amp; i &amp;gt;= 1) &amp;amp;&amp;amp; i &amp;lt; str_ar.length-1) ? ","+out : out;
            }
        }
        return out;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;trace(commaFormat(123));&lt;/h3&gt;

&lt;p&gt;// output: 123&lt;/p&gt;

&lt;h3&gt;trace(commaFormat(123456));&lt;/h3&gt;

&lt;p&gt;// output: 123,456&lt;/p&gt;

&lt;h3&gt;trace(commaFormat(1234567890.12345));&lt;/h3&gt;

&lt;p&gt;// output: 1,234,567,890.12345&lt;/p&gt;

&lt;p&gt;can be written better, however this should be fast enough in most cases.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;var i:Int;
var s:StopWatch = new StopWatch();
for(i in 0...10000){
    Utils.commaFormat(123123123123123123123);
}
s.stop();
trace(s);
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;0.767 ms&lt;/strong&gt;&lt;/p&gt;
          &lt;img src="http://feeds.feedburner.com/~r/RemixTechnologyFeed/~4/x6DduItswDk" height="1" width="1"/&gt;</content>  <feedburner:origLink>http://remixtechnology.com/view/haxe_commaformat</feedburner:origLink></entry>
  <entry xml:base="http://remixtechnology.com/">
    <author>
      <name>theRemix</name>
    </author>
    <id>tag:remixtechnology.com,2009-08-21:45378</id>
    <published>2009-08-21T23:43:00Z</published>
    <updated>2009-08-22T06:11:47Z</updated>
    <category term="haXe Projects" />
    <category term="actionscript3" />
    <category term="animation" />
    <category term="audio" />
    <category term="haxe" />
    <category term="source" />
    <category term="toy" />
    <link href="http://feedproxy.google.com/~r/RemixTechnologyFeed/~3/w6TpOsnRkL8/songsincode-jump_around" rel="alternate" type="text/html" />
    <title>jumpAround(audio_level); #songsInCode</title>
<summary type="html">&lt;p&gt;Made another &lt;a href="http://search.twitter.com/search?q=%23songsInCode"&gt;#songsInCode&lt;/a&gt; in &lt;a href="/tags/haXe"&gt;haXe&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;much funner this time.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;if(audio_level &amp;gt; threshold){
    house_of_pain[j].jumpAround(audio_level);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;

You need &lt;a href="http://get.adobe.com/flashplayer/" title="Get Flash"&gt;Flash 10&lt;/a&gt; to view the awesome. It’s a free and fast upgrade.
&lt;/p&gt;  

&lt;p&gt;let it load, press play.&lt;br /&gt;
House of Pain - Jump Around (Deadmau5 remix)&lt;/p&gt;

&lt;p&gt;&lt;a href="/view/songsInCode-jump_around"&gt;read more to see the source code and result in action…&lt;/a&gt;&lt;/p&gt;</summary><content type="html">
            &lt;p&gt;Made another &lt;a href="http://search.twitter.com/search?q=%23songsInCode"&gt;#songsInCode&lt;/a&gt; in &lt;a href="/tags/haXe"&gt;haXe&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;much funner this time.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;if(audio_level &amp;gt; threshold){
    house_of_pain[j].jumpAround(audio_level);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;

You need &lt;a href="http://get.adobe.com/flashplayer/" title="Get Flash"&gt;Flash 10&lt;/a&gt; to view the awesome. It’s a free and fast upgrade.
&lt;/p&gt;  

&lt;p&gt;let it load, press play.&lt;br /&gt;
House of Pain - Jump Around (Deadmau5 remix)&lt;/p&gt;

&lt;p&gt;&lt;a href="/view/songsInCode-jump_around"&gt;read more to see the source code and result in action…&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;For &lt;a href="http://search.twitter.com/search?q=%23songsInCode"&gt;#songsInCode&lt;/a&gt; written and compiled in &lt;a href="/tags/haXe"&gt;haXe&lt;/a&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;if(audio_level &amp;gt; threshold){
    house_of_pain[j].jumpAround(audio_level);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;

You need &lt;a href="http://get.adobe.com/flashplayer/" title="Get Flash"&gt;Flash 10&lt;/a&gt; to view the awesome. It’s a free and fast upgrade.
&lt;/p&gt;  

&lt;p&gt;let it load, press play.&lt;br /&gt;
House of Pain - Jump Around (Deadmau5 remix)&lt;/p&gt;

&lt;h1&gt;Full source&lt;/h1&gt;

&lt;h3&gt;build.hxml&lt;/h3&gt;

&lt;pre&gt;&lt;code&gt;#build file
-cp src
-swf-version 9
-swf-header 500:200:300:FFFFFF
-main JumpAround
-swf deploy/out.swf
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;JumpAround.hx&lt;/h3&gt;

&lt;pre&gt;&lt;code&gt;import flash.media.Sound;
import flash.media.SoundChannel;
import flash.media.SoundMixer;
import flash.media.SoundTransform;
import flash.media.SoundLoaderContext;
import flash.net.URLRequest;
import flash.events.Event;
import flash.events.IOErrorEvent;
import flash.utils.ByteArray;
import flash.Lib;
class JumpAround
{
    private var sound:Sound;
    private var transform: SoundTransform;
    private var channel:SoundChannel;
    private var spectrum: ByteArray;
    private var bl: Int;
    private var cl: Int;
    private var play_but: PlayPauseBut;

    private var house_of_pain: Array&amp;lt;Guy&amp;gt;;
    private static inline var house_of_pain_member_count: Int = 3;
    private var crowd: Array&amp;lt;Extra&amp;gt;;
    private static inline var crowd_count: Int = 8;

    private static inline var gravity: Float = 2.4;
    private static inline var threshold: Float = .26;
    private static inline var fft:Bool = true;
    private static inline var stretch:Int = 1;
    private static inline var PATH_TO_MP3: String = "DeadMau5_JumpAround.mp3";


    public function new()
    {
        house_of_pain = new Array&amp;lt;Guy&amp;gt;();
        crowd = new Array&amp;lt;Extra&amp;gt;();
        var i:Int;
        var guy:Guy;
        var extra:Extra;

        for(i in 0...crowd_count){
            extra = new Extra();
            crowd.push(extra);
            Lib.current.addChild(extra);
            extra.x = Lib.current.stage.stageWidth / crowd_count *i + (Lib.current.stage.stageWidth / crowd_count / 2);
            extra.y = Lib.current.stage.stageHeight - extra.RADIUS*1.5;
        }

        for(i in 0...house_of_pain_member_count){
            guy = new Guy();
            house_of_pain.push(guy);
            Lib.current.addChild(guy);
            guy.x = Lib.current.stage.stageWidth / house_of_pain_member_count *i + (Lib.current.stage.stageWidth / house_of_pain_member_count / 2);
            guy.y = Lib.current.stage.stageHeight - guy.RADIUS;
        }

        transform = new SoundTransform();
        loadSong(PATH_TO_MP3);
        spectrum = new ByteArray();

        bl = Std.int(256/house_of_pain_member_count);
        cl = Std.int(256/crowd_count);
        Lib.current.addEventListener( Event.ENTER_FRAME, loop );
    }

    private inline function loop( _ ): Void
    {
        SoundMixer.computeSpectrum(spectrum,fft,stretch);
        var i:Int;
        var j:Int = 0;
        var cj:Int = 0;
        var audio_level:Float = 0;
        var caudio_level:Float = 0;

        var s:Float = 0;
        var f:Float = 0;
        var cf:Float = 0;
        var avg:Float;
        for(i in 0...255){ // 512 for both channels, 256-1 cause  256/3 * 3 = 255
            s = spectrum.readFloat();
            f += s;
            cf += s;
            if(i % bl == 0){

                audio_level = f / bl;

                // lew end of spectrum gets lower threshold
                if(j == 0 &amp;amp;&amp;amp; audio_level &amp;gt; threshold*.04){
                    house_of_pain[0].jumpAround(audio_level*40);
                }else if(audio_level &amp;gt; threshold){
                    house_of_pain[j].jumpAround(audio_level);
                }
                j++;
                f = 0;
            }

            if(i % cl == 0 &amp;amp;&amp;amp; cj &amp;lt; crowd_count){
                caudio_level = cf / cl;
                // lew end of spectrum gets lower threshold
                if(cj == 0 &amp;amp;&amp;amp; caudio_level &amp;gt; threshold*.05){
                    crowd[0].jumpAround(caudio_level*6);
                }else if(cj &amp;lt; crowd_count/3 &amp;amp;&amp;amp; caudio_level &amp;gt; threshold){
                    crowd[cj].jumpAround(caudio_level);
                }else if(caudio_level &amp;gt; threshold){
                    crowd[cj].jumpAround(caudio_level*.5);
                }
                cj++;
                cf = 0;

            }

        }
        getDown();
    }

    private inline function getDown(  ): Void
    {
        var guy:Guy;
        var extra:Extra;
        for(guy in house_of_pain){
            if(!guy.onTheFloor()){
                guy.y+=gravity;
            }
            if(!guy.handDown()){
                guy.right_hand.y+=gravity;
            }
        }
        for(extra in crowd){
            if(!extra.onTheFloor()){
                extra.y+=gravity;
            }
            if(!extra.handDown()){
                extra.right_hand.y+=gravity;
            }
        }
    }

    private inline function loadSong(file:String):Void
    {
        sound = new Sound();
        var req:URLRequest = new URLRequest(file);
        var context:SoundLoaderContext = new SoundLoaderContext(8000,true);
        sound.addEventListener(IOErrorEvent.IO_ERROR, io_error);
        sound.addEventListener(Event.COMPLETE, soundLoaded);
        sound.load(req,context);
    }

    private inline function soundLoaded(_):Void
    {
        play_but = new PlayPauseBut(sound);
        Lib.current.addChild(play_but);
    }

    private inline function io_error(_):Void{ trace("can't load mp3"); }

    public static function main(): Void
    {
        var m: JumpAround = new JumpAround();
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;ok it’s not the most elegant code…&lt;/p&gt;

&lt;h3&gt;Guy.hx&lt;/h3&gt;

&lt;pre&gt;&lt;code&gt;import flash.display.Sprite;
import flash.Lib;
class Guy extends Sprite{
    private static inline var HAND_RADIUS: Float = 12;
    private var COLOR: UInt;
    private var HAND_COLOR: UInt;
    public var RADIUS: Float;
    private static inline var JUMP_HEIGHT_MULTIPLIER: Float = 90;

    private var left_hand: Sprite;
    public var right_hand: Sprite;
    public function new(radius = 25, color = 0x359040, hand_color = 0xEFD9C8){
        super();
        RADIUS = radius;
        COLOR =  color;
        HAND_COLOR = hand_color; // forgot how to override

        graphics.beginFill(this.COLOR);
        graphics.drawCircle(0,0,RADIUS);
        graphics.endFill();

        left_hand = new Sprite();
        left_hand.graphics.beginFill(HAND_COLOR);
        left_hand.graphics.drawCircle(RADIUS,HAND_RADIUS,HAND_RADIUS);
        left_hand.graphics.endFill();
        addChild(left_hand);

        right_hand = new Sprite();
        right_hand.graphics.beginFill(HAND_COLOR);
        right_hand.graphics.drawCircle(-RADIUS,HAND_RADIUS,HAND_RADIUS);
        right_hand.graphics.endFill();
        addChild(right_hand);
    }

    public inline function onTheFloor(  ): Bool
    {
        if(y &amp;gt;= Lib.current.stage.stageHeight - RADIUS){
            right_hand.y = 0;
            return true;
        }else{
            return false;
        }
    }

    public inline function handDown(  ): Bool
    {
        if(right_hand.y &amp;gt;= 0){
            return true;
        }else{
            return false;
        }
    }

    public inline function jumpAround( _height:Float ): Void
    {
        if(onTheFloor()){
            y-= _height * JUMP_HEIGHT_MULTIPLIER;
            right_hand.y-= _height * HAND_RADIUS*10;
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Extra.hx&lt;/h3&gt;

&lt;pre&gt;&lt;code&gt;class Extra extends Guy{ // not sure why anymore

    public function new(){
        super(35, 0x157020, 0xCFB9A8);
        scaleX = scaleY = .6;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;PlayPauseBut.hx&lt;/h3&gt;

&lt;pre&gt;&lt;code&gt;import com.remixtechnology.ShadowedTextField;
import flash.events.MouseEvent;
import flash.display.Sprite;
import flash.media.Sound;
import flash.media.SoundMixer;
import flash.media.SoundChannel;
class PlayPauseBut extends Sprite{
    private var start_txt: ShadowedTextField;
    private var stop_txt: ShadowedTextField;
    private var sound: Sound;
    private var playing: Bool;
    private var position: Float;
    private var channel: SoundChannel;
    public function new(_sound:Sound){
        sound = _sound;
        super();
        start_txt = new ShadowedTextField("Play");
        start_txt.setColor(0x7799CC);
        start_txt.setSize(24);
        stop_txt = new ShadowedTextField("Pause");
        stop_txt.setColor(0x888888);

        addChild(start_txt);

        addEventListener(MouseEvent.CLICK, click_start);
        position = 0;
    }
    private inline function click_start( _ ): Void
    {
        if(!playing){
            removeChild(start_txt);
            addChild(stop_txt);
            channel = sound.play(position);
            playing = true;
        }else{
            removeChild(stop_txt);
            addChild(start_txt);
            position = channel.position;
            channel.stop();
            playing = false;
        }
    }
    private inline function click_stop( _ ): Void
    {

    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;com.remixtechnology.ShadowedTextField&lt;/h3&gt;

&lt;pre&gt;&lt;code&gt;package com.remixtechnology;

import flash.display.Sprite;
import flash.text.TextField;
import flash.text.TextFieldAutoSize;
import flash.text.TextFormat;
import flash.text.AntiAliasType;

class ShadowedTextField extends Sprite
{

    private var fgColor:UInt;
    private var bgColor:UInt;
    private var xoff:Float;
    private var yoff:Float;

    private var tfFore:TextField;
    private var tfBack:TextField;
    private var fmtFore:TextFormat;
    private var fmtBack:TextFormat;

    private var size:Int;
    private var font:String;

    public function new( ?text:String )
    {
        bgColor = 0x000000;
        fgColor = 0xFFCC00;
        xoff = 1;
        yoff = 1;
        size = 14;
        font = 'Verdana';

        mouseChildren = false;
        mouseEnabled = false;

        tfBack = new TextField();
        tfBack.autoSize = TextFieldAutoSize.LEFT;
        tfBack.selectable = false;
        tfBack.x = xoff;
        tfBack.y = yoff;
        addChild(tfBack);

        tfFore = new TextField();
        tfFore.autoSize = TextFieldAutoSize.LEFT;
        tfFore.selectable = false;
        addChild(tfFore);

        fmtFore = new TextFormat();
        fmtFore.color = fgColor;
        fmtFore.size = size;
        fmtFore.font = font;
        fmtFore.bold = true;

        fmtBack = new TextFormat();
        fmtBack.color = bgColor;
        fmtBack.size = size;
        fmtBack.font = font;
        fmtBack.bold = true;

        if(text != null) setText(text);

        super();
    }

    public inline function setText(n:String):Void
    {
        tfFore.text = n;
        tfFore.setTextFormat(fmtFore);

        tfBack.text = n;
        tfBack.setTextFormat(fmtBack);
    }

    public inline function appendText(n:String):Void
    {
        tfFore.appendText("\n" + n);
        tfFore.setTextFormat(fmtFore);

        tfBack.appendText("\n" + n);
        tfBack.setTextFormat(fmtBack);
    }

    public inline function setColor(color:UInt):Void
    {
        fmtFore.color = color;
        tfFore.setTextFormat(fmtFore);
    }

    public inline function setShadowColor(color:UInt):Void
    {
        fmtBack.color = color;
        tfBack.setTextFormat(fmtBack);
    }

    public inline function setSize(size:Int):Void{
        fmtFore.size = size;
        tfFore.setTextFormat(fmtFore);

        fmtBack.size = size;
        tfBack.setTextFormat(fmtBack);
    }

    public inline function bold(b:Bool):Void{
        if(b){
            fmtFore.bold = true;
            fmtBack.bold = true;
        }else{
            fmtFore.bold = false;
            fmtBack.bold = false;
        }
    }

}
&lt;/code&gt;&lt;/pre&gt;
          &lt;img src="http://feeds.feedburner.com/~r/RemixTechnologyFeed/~4/w6TpOsnRkL8" height="1" width="1"/&gt;</content>  <feedburner:origLink>http://remixtechnology.com/view/songsincode-jump_around</feedburner:origLink></entry>
  <entry xml:base="http://remixtechnology.com/">
    <author>
      <name>theRemix</name>
    </author>
    <id>tag:remixtechnology.com,2009-08-21:45377</id>
    <published>2009-08-21T02:23:00Z</published>
    <updated>2009-08-21T02:24:36Z</updated>
    <category term="haXe Projects" />
    <category term="actionscript3" />
    <category term="animation" />
    <category term="haxe" />
    <category term="source" />
    <category term="toy" />
    <link href="http://feedproxy.google.com/~r/RemixTechnologyFeed/~3/lC89PfCVFzI/songsincode-ring_around_the_rosy" rel="alternate" type="text/html" />
    <title>ringAround(rosies); #songsInCode</title>
<summary type="html">&lt;p&gt;Felt like making a &lt;a href="http://search.twitter.com/search?q=%23songsInCode"&gt;#songsInCode&lt;/a&gt; in &lt;a href="/tags/haXe"&gt;haXe&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;and just for fun actually writing the code and compiling it to see how it might look.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;ringAround(rosies);
for(girl in girls){
    girl.pocket.fill(new Posies());
}
ashes+=2;
for(girl in girls){
    girl.fall(DOWN);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;a href="/view/songsInCode-ring_around_the_rosy"&gt;read more to see the source code and result in action…&lt;/a&gt;&lt;/p&gt;</summary><content type="html">
            &lt;p&gt;Felt like making a &lt;a href="http://search.twitter.com/search?q=%23songsInCode"&gt;#songsInCode&lt;/a&gt; in &lt;a href="/tags/haXe"&gt;haXe&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;and just for fun actually writing the code and compiling it to see how it might look.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;ringAround(rosies);
for(girl in girls){
    girl.pocket.fill(new Posies());
}
ashes+=2;
for(girl in girls){
    girl.fall(DOWN);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;a href="/view/songsInCode-ring_around_the_rosy"&gt;read more to see the source code and result in action…&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Felt like making a &lt;a href="http://search.twitter.com/search?q=%23songsInCode"&gt;#songsInCode&lt;/a&gt; in &lt;a href="/tags/haXe"&gt;haXe&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;and just for fun actually writing the code and compiling it to see how it might look.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;ringAround(rosies);
for(girl in girls){
    girl.pocket.fill(new Posies());
}
ashes+=2;
for(girl in girls){
    girl.fall(DOWN);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;result… meh.&lt;/p&gt;

&lt;p&gt;

You need &lt;a href="http://get.adobe.com/flashplayer/" title="Get Flash"&gt;Flash 10&lt;/a&gt; to view the awesome. It’s a free and fast upgrade.
&lt;/p&gt;

&lt;h1&gt;Full source&lt;/h1&gt;

&lt;h3&gt;build.hxml&lt;/h3&gt;

&lt;pre&gt;&lt;code&gt;#build file
-cp src
-swf-version 9
-swf-header 550:450:30:F5F0D9
-main RingAroundTheRosy
-swf deploy/out.swf
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;RingAroundTheRosy.hx&lt;/h3&gt;

&lt;pre&gt;&lt;code&gt;/*
    Ring around the rosy
    A pocketful of posies
    "Ashes, Ashes"
    We all fall down!

    ringAround(rosies);
    for(girl in girls){
        girl.pocket.fill(new Posies());
    }
    ashes+=2;
    for(girl in girls){
        girl.fall(DOWN);
    }

    ringAround(rosies);
    for(girl in girls){ girl.pocket.fill(new Posies()); } 
    ashes+=2;
    for(girl in girls){ girl.fall(DOWN); } 
    #songsInCode

*/
import haxe.Timer;
import com.remixtechnology.Utils;
import flash.Lib;
import flash.events.Event;
class RingAroundTheRosy
{
    private var girls: Array&amp;lt;Girl&amp;gt;;
    private var rhyme_timer: Timer;
    private var rhyme_line_counter: Int;
    private var rhyme_lines: Array&amp;lt;String&amp;gt;;
    private var rosies: Rosies;
    private var ashes: Int;

    private static inline var DOWN: String = "DOWN";
    private static inline var GIRL_COUNT: Int = 5;
    private static inline var RHYME_SPEED: Int = 3000; // 3seconds
    private static inline var DANCE_SPEED: Float = .04; // girls rotating in circular motion
    private static inline var DANCE_RADIUS: Float = Rosies.RADIUS + Girl.RADIUS + 20;
    private static inline var DANCE_PADDING: Float = 1.3; // hard coded, but should be calculated off known radiuses
    private static var RHYME_LINES: Array&amp;lt;String&amp;gt; = [
        '"Ring around the rosy"',
        '"A pocketful of posies"',
        '"Ashes, Ashes"',
        '"We all fall down!"'
    ];
    private static var RHYME_IN_CODE_LINES: Array&amp;lt;String&amp;gt; = [
"ringAround(rosies);",
"for(girl in girls){
    girl.pocket.fill(new Posies());
}",
"ashes+=2;",
"for(girl in girls){
    girl.fall(DOWN);
}"
    ];
    private static inline var RHYME_COLOR: UInt = 0x812030;
    private static inline var SPAWN_WICKED_GIRLS_LINE: Int = 0;
    private static inline var FILL_POCKETS_LINE: Int = 1;
    private static inline var SENSELESS_ASHES_LINE: Int = 2;
    private static inline var DESTROY_ALL_GIRLS_LINE: Int = 3;

    public function new()
    {
        rhyme_timer = new Timer(RHYME_SPEED);
        rhyme_timer.run = rhyme_tick;
        rhyme_lines = RHYME_LINES;

        Utils.updateTrace("");
        Utils.stf.setColor(RHYME_COLOR);

        rosies = new Rosies();
        Lib.current.addChild(rosies);

    }

    private inline function rhyme_tick(  ): Void
    {
        Utils.trace(rhyme_lines[rhyme_line_counter]);

        switch(rhyme_line_counter){

            case SPAWN_WICKED_GIRLS_LINE:

                ringAround(rosies);

            case FILL_POCKETS_LINE:

                for(girl in girls){
                    girl.pocket.fill(new Posies());
                }

            case SENSELESS_ASHES_LINE:

                ashes+=2;

            case DESTROY_ALL_GIRLS_LINE:

                for(girl in girls){
                    girl.fall(DOWN);
                }
        }

        if(rhyme_line_counter++ == rhyme_lines.length){
            rhyme_line_counter = 0;
            if(rhyme_lines == RHYME_LINES){
                rhyme_lines = RHYME_IN_CODE_LINES;
            }else{
                rhyme_lines = RHYME_LINES;
            }
            Utils.updateTrace("");
        }
    }

    private inline function ringAround( target:Rosies ): Void
    {
        girls = new Array&amp;lt;Girl&amp;gt;();

        var i:Int;
        var girl:Girl;
        for(i in 0...GIRL_COUNT){

            // initial position
            girl = new Girl(this);
            girls.push(girl);
            girl.pocket.x = Math.sin(i) * Girl.RADIUS;
            girl.pocket.y = Math.cos(i) * Girl.RADIUS;
            girl.angle = i*DANCE_PADDING;
            girl.x = rosies.x + Math.sin(girl.angle) * DANCE_RADIUS;
            girl.y = rosies.y + Math.cos(girl.angle) * DANCE_RADIUS;
            Lib.current.addChild(girl);

            // add loop
            girl.addEventListener(Event.ENTER_FRAME, loop);
        }
    }

    public inline function loop(event:Event):Void{
        var girl:Girl = cast(event.target, Girl);
        girl.x = rosies.x + Math.sin(girl.angle) * DANCE_RADIUS;
        girl.y = rosies.y + Math.cos(girl.angle)  * DANCE_RADIUS;
        girl.angle += DANCE_SPEED;
    }

    public static function main(): Void
    {
        var m: RingAroundTheRosy = new RingAroundTheRosy();
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Girl.hx&lt;/h3&gt;

&lt;pre&gt;&lt;code&gt;import flash.display.Sprite;
import flash.events.Event;
import flash.Lib;
class Girl extends Sprite{

    private var main: RingAroundTheRosy;
    private var fallspeed: Float;

    public var pocket: Pocket;
    public var angle: Float;

    private static inline var COLOR: UInt = 0xF093BC;
    public static inline var RADIUS: Float = 20; // girls that reveal their true weight O_O
    private static inline var FALL_FACTOR: Float = 1.5;

    public function new( _main:RingAroundTheRosy )
    {
        main = _main;
        super();
        graphics.beginFill(COLOR);
        graphics.drawCircle(0,0,RADIUS);
        graphics.endFill();

        pocket = new Pocket(); // yes they can only afford one
        addChild(pocket);

        addEventListener(Event.ENTER_FRAME, loop);

        fallspeed = 1;
    }

    private inline function loop( _ ): Void
    {
        rotation++;
    }

    private function falling( _ ): Void
    {
        y+= fallspeed *= FALL_FACTOR;
        if(y &amp;gt; Lib.current.stage.stageHeight + RADIUS){
            Lib.current.removeChild(this);
            removeEventListener(Event.ENTER_FRAME, loop);
            removeEventListener(Event.ENTER_FRAME, main.loop);
            removeEventListener(Event.ENTER_FRAME, falling);
        }
    }

    public inline function fall( where:String ): Void
    {
        // "where" does nothing really
        addEventListener(Event.ENTER_FRAME, falling);
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Pocket.hx&lt;/h3&gt;

&lt;pre&gt;&lt;code&gt;import flash.display.Sprite;
import flash.display.DisplayObject;
class Pocket extends Sprite{

    private static inline var COLOR: UInt = 0xA0538C;
    private static inline var RADIUS: Float = 10;

    public function new(  )
    {
        super();
        graphics.beginFill(COLOR);
        graphics.drawCircle(0,0,RADIUS);
        graphics.endFill();
    }

    public inline function fill( stuff:DisplayObject ): Void
    {
        addChild(stuff);
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Posies.hx&lt;/h3&gt;

&lt;pre&gt;&lt;code&gt;import flash.display.Sprite;
class Posies extends Sprite{

    private static inline var COLOR: UInt = 0x9F8F23;
    private static inline var RADIUS: Float = 6;

    public function new(  )
    {
        super();
        graphics.beginFill(COLOR);
        graphics.drawCircle(0,0,RADIUS);
        graphics.endFill();
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Rosies.hx&lt;/h3&gt;

&lt;pre&gt;&lt;code&gt;import flash.display.Sprite;
import flash.events.Event;
import flash.Lib;
class Rosies extends Sprite{

    private static inline var COLOR: UInt = 0x450408;
    public static inline var RADIUS: Float = 35;

    public function new(  )
    {
        super();
        graphics.beginFill(COLOR);
        graphics.drawCircle(0,0,RADIUS);
        graphics.endFill();

        addEventListener(Event.ENTER_FRAME, loop);
    }

    private inline function loop( _ ): Void
    {
        x = Lib.current.mouseX;
        y = Lib.current.mouseY;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;com.remixtechnology.Utils&lt;/h3&gt;

&lt;p&gt;snippet, not full class file, only includes methods used for this app&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;package com.remixtechnology;
import flash.Lib;
import flash.Error;
import flash.display.Stage;
import flash.display.Sprite;
import flash.display.DisplayObject;
import flash.display.DisplayObjectContainer;
class Utils{
    public static var stf:ShadowedTextField;


    public static inline function trace(obj:Dynamic):Void{
        if(stf == null){
            stf = new ShadowedTextField();
            Lib.current.stage.addChild(stf);
            stf.setText(Std.string(obj));
        }else{
            stf.appendText(Std.string(obj));
        }
    }
    public static function updateTrace(obj:Dynamic):Void{
        if(stf != null){
            stf.setText(Std.string(obj));
        }else{
            Utils.trace(obj);
        }
    }

}
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;com.remixtechnology.ShadowedTextField&lt;/h3&gt;

&lt;pre&gt;&lt;code&gt;package com.remixtechnology;

import flash.display.Sprite;
import flash.text.TextField;
import flash.text.TextFieldAutoSize;
import flash.text.TextFormat;
import flash.text.AntiAliasType;

class ShadowedTextField extends Sprite
{

    private var fgColor:UInt;
    private var bgColor:UInt;
    private var xoff:Float;
    private var yoff:Float;

    private var tfFore:TextField;
    private var tfBack:TextField;
    private var fmtFore:TextFormat;
    private var fmtBack:TextFormat;

    private var size:Int;
    private var font:String;

    public function new( ?text:String )
    {
        bgColor = 0x000000;
        fgColor = 0xFFCC00;
        xoff = 1;
        yoff = 1;
        size = 14;
        font = 'Verdana';

        mouseChildren = false;
        mouseEnabled = false;

        tfBack = new TextField();
        tfBack.autoSize = TextFieldAutoSize.LEFT;
        tfBack.selectable = false;
        tfBack.x = xoff;
        tfBack.y = yoff;
        addChild(tfBack);

        tfFore = new TextField();
        tfFore.autoSize = TextFieldAutoSize.LEFT;
        tfFore.selectable = false;
        addChild(tfFore);

        fmtFore = new TextFormat();
        fmtFore.color = fgColor;
        fmtFore.size = size;
        fmtFore.font = font;
        fmtFore.bold = true;

        fmtBack = new TextFormat();
        fmtBack.color = bgColor;
        fmtBack.size = size;
        fmtBack.font = font;
        fmtBack.bold = true;

        if(text != null) setText(text);

        super();
    }

    public inline function setText(n:String):Void
    {
        tfFore.text = n;
        tfFore.setTextFormat(fmtFore);

        tfBack.text = n;
        tfBack.setTextFormat(fmtBack);
    }

    public inline function appendText(n:String):Void
    {
        tfFore.appendText("\n" + n);
        tfFore.setTextFormat(fmtFore);

        tfBack.appendText("\n" + n);
        tfBack.setTextFormat(fmtBack);
    }

    public inline function setColor(color:UInt):Void
    {
        fmtFore.color = color;
        tfFore.setTextFormat(fmtFore);
    }

    public inline function setShadowColor(color:UInt):Void
    {
        fmtBack.color = color;
        tfBack.setTextFormat(fmtBack);
    }

    public inline function setSize(size:Int):Void{
        fmtFore.size = size;
        tfFore.setTextFormat(fmtFore);

        fmtBack.size = size;
        tfBack.setTextFormat(fmtBack);
    }

    public inline function bold(b:Bool):Void{
        if(b){
            fmtFore.bold = true;
            fmtBack.bold = true;
        }else{
            fmtFore.bold = false;
            fmtBack.bold = false;
        }
    }

}
&lt;/code&gt;&lt;/pre&gt;
          &lt;img src="http://feeds.feedburner.com/~r/RemixTechnologyFeed/~4/lC89PfCVFzI" height="1" width="1"/&gt;</content>  <feedburner:origLink>http://remixtechnology.com/view/songsincode-ring_around_the_rosy</feedburner:origLink></entry>
  <entry xml:base="http://remixtechnology.com/">
    <author>
      <name>theRemix</name>
    </author>
    <id>tag:remixtechnology.com,2009-08-20:45376</id>
    <published>2009-08-20T20:53:00Z</published>
    <updated>2009-08-20T20:54:02Z</updated>
    <category term="game" />
    <category term="video" />
    <link href="http://feedproxy.google.com/~r/RemixTechnologyFeed/~3/HNRaC5ueQ4w/insanely_twisted_shadow_world-game_trailer" rel="alternate" type="text/html" />
    <title>Insanely Twisted Shadow World - Game Trailer</title>
<content type="html">
            &lt;p&gt;

You need &lt;a href="http://get.adobe.com/flashplayer/" title="Get Flash"&gt;Flash 10&lt;/a&gt; to view the awesome. It’s a free and fast upgrade.
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.gametrailers.com/video/exclusive-extended-insanely-twisted/52779"&gt;Link to HD video on gt.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;do i even need to write about this? watch the video and you’ll see why it deserves to be posted here.&lt;/p&gt;
          &lt;img src="http://feeds.feedburner.com/~r/RemixTechnologyFeed/~4/HNRaC5ueQ4w" height="1" width="1"/&gt;</content>  <feedburner:origLink>http://remixtechnology.com/view/insanely_twisted_shadow_world-game_trailer</feedburner:origLink></entry>
  <entry xml:base="http://remixtechnology.com/">
    <author>
      <name>theRemix</name>
    </author>
    <id>tag:remixtechnology.com,2009-08-20:45375</id>
    <published>2009-08-20T20:23:00Z</published>
    <updated>2009-08-20T20:30:42Z</updated>
    <category term="audio" />
    <category term="flash" />
    <category term="toy" />
    <link href="http://feedproxy.google.com/~r/RemixTechnologyFeed/~3/h7bYlW5LuT4/soytuaire-labuat-com-amazing-flash-interactive-music-video" rel="alternate" type="text/html" />
    <title>Amazing flash Interactive Music Video</title>
<content type="html">
            &lt;p&gt;I rarely post other people’s work on this site unless it’s just too amazing to not talk about…&lt;br /&gt;
…this is one of those times.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://soytuaire.labuat.com"&gt;http://soytuaire.labuat.com&lt;/a&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;music_video_loader.addEventListener(Event.COMPLETE, jaw_drops);
&lt;/code&gt;&lt;/pre&gt;
          &lt;img src="http://feeds.feedburner.com/~r/RemixTechnologyFeed/~4/h7bYlW5LuT4" height="1" width="1"/&gt;</content>  <feedburner:origLink>http://remixtechnology.com/view/soytuaire-labuat-com-amazing-flash-interactive-music-video</feedburner:origLink></entry>
  <entry xml:base="http://remixtechnology.com/">
    <author>
      <name>theRemix</name>
    </author>
    <id>tag:remixtechnology.com,2009-08-20:45373</id>
    <published>2009-08-20T04:10:00Z</published>
    <updated>2009-08-20T05:34:24Z</updated>
    <category term="actionscript3" />
    <category term="animation" />
    <category term="flash" />
    <category term="screenshot" />
    <category term="source" />
    <category term="tutorial" />
    <category term="tween" />
    <link href="http://feedproxy.google.com/~r/RemixTechnologyFeed/~3/uvyVn--Pc2Y/flash-actionscript3-tutorial-animated-slideshow" rel="alternate" type="text/html" />
    <title>Flash Actionscript3 Tutorial : Animated Slideshow</title>
<summary type="html">&lt;p&gt;Using TweenLite to generate the animations for a simple flash slideshow built using Flash IDE.&lt;/p&gt;

&lt;p&gt;my goal was was to create a looping slideshow as simply as possible. least amount of steps. and with some room to expand on.&lt;br /&gt;
this tutorial is made to help understand the logic and some basic moving parts involved in a general slideshow.&lt;br /&gt;
it certainly won’t fit all slideshow needs, especially ones with lots of slides, or with constantly changing slides.&lt;br /&gt;
source files available.&lt;/p&gt;

&lt;p&gt;epic ending… srsly.&lt;/p&gt;</summary><content type="html">
            &lt;p&gt;Using TweenLite to generate the animations for a simple flash slideshow built using Flash IDE.&lt;/p&gt;

&lt;p&gt;my goal was was to create a looping slideshow as simply as possible. least amount of steps. and with some room to expand on.&lt;br /&gt;
this tutorial is made to help understand the logic and some basic moving parts involved in a general slideshow.&lt;br /&gt;
it certainly won’t fit all slideshow needs, especially ones with lots of slides, or with constantly changing slides.&lt;br /&gt;
source files available.&lt;/p&gt;

&lt;p&gt;epic ending… srsly.&lt;/p&gt;
&lt;h2&gt;The Slideshow&lt;/h2&gt;

&lt;p&gt;the end product&lt;/p&gt;

&lt;p&gt;

You need &lt;a href="http://get.adobe.com/flashplayer/" title="Get Flash"&gt;Flash 10&lt;/a&gt; to view the awesome. It’s a free and fast upgrade.
&lt;/p&gt;

&lt;p&gt;&lt;em&gt;i’m using photos from &lt;a href="http://blog.byhumanhand.com"&gt;Humanhand Blog&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This tutorial is for Flash CS3/CS4 using Actionscript 3.0&lt;/p&gt;

&lt;p&gt;&lt;a href="/assets/2009/8/20/Slideshow.zip"&gt;Here is the full source&lt;/a&gt;  &lt;/p&gt;

&lt;h2&gt;Step 1. Gather all resources and code libraries.&lt;/h2&gt;

&lt;p&gt;We’ll need some images to slide around, and the TweenLite library.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Setup your project directory “Slideshow”.  &lt;/li&gt;
&lt;li&gt;In Flash CS3/4 - Create a new Flash File (Actionscript 3.0), save it to Slideshow/Slideshow.fla  &lt;/li&gt;
&lt;li&gt;Get the latest &lt;a href="http://www.greensock.com/as/greensock-tweening-platform-as3.zip"&gt;TweenLite for Actionscript 3.0&lt;/a&gt; from &lt;a href="http://blog.greensock.com/tweenliteas3/"&gt;http://blog.greensock.com/tweenliteas3/&lt;/a&gt;&lt;br /&gt;
extract it and move the *gs* directory to Slideshow/gs/&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Back in Flash CS3/4, make sure your library is open, drag some images from your computer into it.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;h2&gt;Step 2. Setup library linking&lt;/h2&gt;

&lt;p&gt;Right click / Command+click on the first library image to open it’s library properties pane&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click on ”&lt;strong&gt;Allow Smoothing&lt;/strong&gt;”  &lt;/li&gt;
&lt;li&gt;Click on ”&lt;strong&gt;Export for Actionscript&lt;/strong&gt;”  &lt;/li&gt;
&lt;li&gt;Rename the class to ”&lt;strong&gt;Photo_0&lt;/strong&gt;” because class names should be Uppercased  &lt;/li&gt;
&lt;li&gt;then hit &lt;em&gt;*OK&lt;/em&gt;*&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Do this to all images in your library. It’s tedious, but we’re learning right now, and we’ll learn how to improve management of your assets later.&lt;br /&gt;
Rename the classes appropriately (like “Photo_2”)&lt;br /&gt;
and always make sure to &lt;strong&gt;Allow Smoothing&lt;/strong&gt; on each image, else your animations will look ugly.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;h2&gt;Step 3. Setup your main class file, Slideshow.as&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Find your Document Properties Panel  &lt;/li&gt;
&lt;li&gt;Under “Publish” find Class: and type in the text area, &lt;strong&gt;Slideshow&lt;/strong&gt;&lt;br /&gt;
yours may look different, if you can’t find the properties panel, go to the main menu, choose “Window” and make sure “Properties” is checked, if not, click it to reveal the properties panel&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Now go to File -&gt; New  and create a new Actionscript File.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;save this file as… &lt;strong&gt;Slideshow/Slideshow.as&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;h2&gt;Step 4. Code !&lt;/h2&gt;

&lt;p&gt;setup our anonymous package&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;package{

}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;import classes that we need&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;import flash.display.Sprite;
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.utils.Timer;
import flash.events.TimerEvent;
import gs.TweenLite;
import gs.easing.*;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;create the Slideshow class that extends flash.display.Sprite, and Slideshow constructor&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;public class Slideshow extends Sprite
{
    public function Slideshow()
    {

    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;this is what we have so far:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;package{
    import flash.display.Sprite;
    import flash.display.Bitmap;
    import flash.display.BitmapData;
    import flash.utils.Timer;
    import flash.events.TimerEvent;
    import gs.TweenLite;
    import gs.easing.*;
    public class Slideshow extends Sprite
    {
        public function Slideshow()
        {

        }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;inside the class&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;define an array to hold all of our images&lt;/li&gt;
&lt;li&gt;define a variable to keep track of which slide we are on called &lt;strong&gt;curSlide&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;define a timer&lt;/li&gt;
&lt;li&gt;and finally define some constants for our slideshow and animation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;you can change the global animation speed and pause duration to whatever you want, they define time in seconds.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;private var slides:Array;
private var curSlide:int;
private var timer:Timer;
private static const ANIMATION_SPEED:Number = 1.5;
private static const PAUSE_DURATION:Number = 3 + ANIMATION_SPEED;
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;inside the constructor&lt;/h3&gt;

&lt;p&gt;stick the photos in the array&lt;br /&gt;
since each Photo extends BitmapData, we need to pass a &lt;em&gt;width&lt;/em&gt; and &lt;em&gt;height&lt;/em&gt; as parameters otherwise the flash compiler will complain&lt;br /&gt;
lets use (0,0)&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;slides = [
    new Photo_0(0,0),
    new Photo_1(0,0),
    new Photo_2(0,0),
    new Photo_3(0,0),
    new Photo_4(0,0),
    new Photo_5(0,0),
    new Photo_6(0,0),
    new Photo_7(0,0),
    new Photo_8(0,0)
];
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;we will be adding these photos onto stage so we can see the slides in this slideshow.&lt;br /&gt;
in order to do that, the photos must be a DisplayObject, so we’ll wrap each one in a new Bitmap object (which extends flash.display.DisplayObject).&lt;br /&gt;
the Bitmap objects are stored in the &lt;strong&gt;slides&lt;/strong&gt; array&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;slides = [
    new Bitmap(new Photo_0(0,0)),
    new Bitmap(new Photo_1(0,0)),
    new Bitmap(new Photo_2(0,0)),
    new Bitmap(new Photo_3(0,0)),
    new Bitmap(new Photo_4(0,0)),
    new Bitmap(new Photo_5(0,0)),
    new Bitmap(new Photo_6(0,0)),
    new Bitmap(new Photo_7(0,0)),
    new Bitmap(new Photo_8(0,0))
];
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;now lets add them to stage, and hide them to the left edge of the stage, initially out of sight&lt;br /&gt;
and vertically center them on stage.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;var i:int;
var l:int = slides.length;
for ( i; i &amp;lt; l; i++ ) {
    addChild(slides[i]);
    slides[i].x = stage.stageWidth;
    slides[i].y = stage.stageHeight/2 - slides[i].height/2;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;after that, create the timer object&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;timer = new Timer(PAUSE_DURATION);
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;so now we have&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;package{
    import flash.display.Sprite;
    import flash.display.Bitmap;
    import flash.display.BitmapData;
    import flash.utils.Timer;
    import flash.events.TimerEvent;
    import gs.TweenLite;
    import gs.easing.*;
    public class Slideshow extends Sprite
    {
        private var slides:Array;
        private var curSlide:int;
        private var timer:Timer;

        private static const ANIMATION_SPEED:Number = 1.5;
        private static const PAUSE_DURATION:Number = 3 + ANIMATION_SPEED;

        public function Slideshow()
        {
            slides = [
                new Bitmap(new Photo_0(0,0)),
                new Bitmap(new Photo_1(0,0)),
                new Bitmap(new Photo_2(0,0)),
                new Bitmap(new Photo_3(0,0)),
                new Bitmap(new Photo_4(0,0)),
                new Bitmap(new Photo_5(0,0)),
                new Bitmap(new Photo_6(0,0)),
                new Bitmap(new Photo_7(0,0)),
                new Bitmap(new Photo_8(0,0))
            ];

            var i:int;
            var l:int = slides.length;
            for ( i; i &amp;lt; l; i++ ){
                addChild(slides[i]);
                slides[i].x = stage.stageWidth;
                slides[i].y = stage.stageHeight/2 - slides[i].height/2;
            }

            timer = new Timer(PAUSE_DURATION);
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;create event listeners, and start the timer.&lt;br /&gt;
after the timer object has been created, add an event listener.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;timer = new Timer(PAUSE_DURATION);
timer.addEventListener(TimerEvent.TIMER, slide);
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;and call&lt;/p&gt;

&lt;p&gt;create a quick helper method to find the horizontal center for the sliding image to land, we’ll use this a couple places&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;private function getCenter(bitmap:Bitmap):Number // find the x endpoint, the horizontal center for the next slide
{
    return stage.stageWidth/2 - bitmap.width/2;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;create an &lt;strong&gt;initial_slide&lt;/strong&gt; method to call once to animate in the first slide&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;private function initial_slide():void // this happens first, and only once
{

}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;in this method, we animate the first slide into view from the right side. then increment the &lt;strong&gt;curSlide&lt;/strong&gt; counter;
our TweenLite.to parameters are  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;what we will animate, the first slide, same as saying slides[0]&lt;/li&gt;
&lt;li&gt;our global animation speed value&lt;/li&gt;
&lt;li&gt;an object that defines 2 options for this animation&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;x&lt;/strong&gt;: here we use the &lt;em&gt;getCenter()&lt;/em&gt; method we just wrote, and pass in the first image so that it returns an accurate x target 
&lt;em&gt;getCenter(slides[curSlide])&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ease&lt;/strong&gt;: i like how &lt;strong&gt;Cubic.easeInOut&lt;/strong&gt; looks, you can change this to your preference&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;private function initial_slide():void // this happens first, and only once
{
    // animate the next slide in
    TweenLite.to(slides[curSlide], ANIMATION_SPEED, {x:getCenter(slides[curSlide]), ease:Cubic.easeInOut});

    // increment curSlide
    curSlide++;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;create the &lt;strong&gt;slide&lt;/strong&gt; method that will run every four and a half seconds&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;public function slide(event:TimerEvent):void{

}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;we’ll handle slideshow looping in this method&lt;br /&gt;
and use TweenLite’s &lt;em&gt;to()&lt;/em&gt; static method to move slides in and out.&lt;/p&gt;

&lt;h3&gt;inside the &lt;strong&gt;slide&lt;/strong&gt; listener&lt;/h3&gt;

&lt;p&gt;define a couple variables that will be animated&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;var newSlide:Bitmap = slides[curSlide];
var oldSlide:Bitmap;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;set where the new slide comes from, off stage right&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;newSlide.x = stage.stageWidth;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;check if we looped and set the &lt;strong&gt;oldSlide&lt;/strong&gt; variable&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;if(curSlide == 0) // slideshow looped, animate out last slide in slides
{
    oldSlide = slides[slides.length-1];
}
else // animate old slide out
{
    oldSlide = slides[curSlide-1];
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;do our animations&lt;br /&gt;
&lt;strong&gt;nextSlide&lt;/strong&gt; starts off stage to the right, animates left to the center&lt;br /&gt;
&lt;strong&gt;oldSlide&lt;/strong&gt; animates left from the center to the far left off stage&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;// animate the next slide in
TweenLite.to(newSlide, ANIMATION_SPEED, {x:getCenter(newSlide), ease:Cubic.easeInOut});

// animate the old slide out
TweenLite.to(oldSlide, ANIMATION_SPEED, {x:-oldSlide.width, ease:Cubic.easeInOut});
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;finally increment the &lt;strong&gt;curSlide&lt;/strong&gt; counter and loop if necessary&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;// increment curSlide or loop
if(curSlide++ == slides.length-1)
{ 
    curSlide = 0;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;the entire &lt;strong&gt;slide&lt;/strong&gt; event listener method looks like this&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;private function slide(event:TimerEvent):void
{
    var newSlide:Bitmap = slides[curSlide];
    var oldSlide:Bitmap;

    // set where this slide comes from , off stage right
    newSlide.x = stage.stageWidth;

    // check if we looped. set oldSlide

    if(curSlide == 0) // slideshow looped, animate out last slide in slides
    {
        oldSlide = slides[slides.length-1];
    }
    else // animate old slide out
    {
        oldSlide = slides[curSlide-1];
    }

    // animate the next slide in
    TweenLite.to(newSlide, ANIMATION_SPEED, {x:getCenter(newSlide), ease:Cubic.easeInOut});

    // animate the old slide out
    TweenLite.to(oldSlide, ANIMATION_SPEED, {x:-oldSlide.width, ease:Cubic.easeInOut});

    // increment curSlide or loop
    if(curSlide++ == slides.length-1)
    { 
        curSlide = 0;
    }

}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Here is the entire &lt;strong&gt;Slideshow.as&lt;/strong&gt; file, all the code you need to complete this project&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;package{
    import flash.display.Sprite;
    import flash.display.Bitmap;
    import flash.display.BitmapData;
    import flash.utils.Timer;
    import flash.events.TimerEvent;
    import gs.TweenLite;
    import gs.easing.*;
    public class Slideshow extends Sprite
    {
        private var slides:Array;
        private var curSlide:int;
        private var timer:Timer;

        private static const ANIMATION_SPEED:Number = 1.5;
        private static const PAUSE_DURATION:Number = 3 + ANIMATION_SPEED;

        public function Slideshow()
        {
            slides = [
                new Bitmap(new Photo_0(0,0)),
                new Bitmap(new Photo_1(0,0)),
                new Bitmap(new Photo_2(0,0)),
                new Bitmap(new Photo_3(0,0)),
                new Bitmap(new Photo_4(0,0)),
                new Bitmap(new Photo_5(0,0)),
                new Bitmap(new Photo_6(0,0)),
                new Bitmap(new Photo_7(0,0)),
                new Bitmap(new Photo_8(0,0))
            ];

            var i:int;
            var l:int = slides.length;
            for ( i; i &amp;lt; l; i++ ){
                addChild(slides[i]);
                slides[i].x = stage.stageWidth;
                slides[i].y = stage.stageHeight/2 - slides[i].height/2;
            }

            timer = new Timer(PAUSE_DURATION*1000);
            timer.addEventListener(TimerEvent.TIMER, slide);
            timer.start();

            initial_slide();
        }
        private function getCenter(bitmap:Bitmap):Number // find the x endpoint, the horizontal center for the next slide
        {
            return stage.stageWidth/2 - bitmap.width/2;
        }
        private function initial_slide():void // this happens first, and only once
        {
            // animate the next slide in
            TweenLite.to(slides[curSlide], ANIMATION_SPEED, {x:getCenter(slides[curSlide]), ease:Cubic.easeInOut});

            // increment curSlide
            curSlide++;
        }
        private function slide(event:TimerEvent):void
        {
            var newSlide:Bitmap = slides[curSlide];
            var oldSlide:Bitmap;

            // set where this slide comes from , off stage right
            newSlide.x = stage.stageWidth;

            // check if we looped. set oldSlide

            if(curSlide == 0) // slideshow looped, animate out last slide in slides
            {
                oldSlide = slides[slides.length-1];
            }
            else // animate old slide out
            {
                oldSlide = slides[curSlide-1];
            }

            // animate the next slide in
            TweenLite.to(newSlide, ANIMATION_SPEED, {x:getCenter(newSlide), ease:Cubic.easeInOut});

            // animate the old slide out
            TweenLite.to(oldSlide, ANIMATION_SPEED, {x:-oldSlide.width, ease:Cubic.easeInOut});

            // increment curSlide or loop
            if(curSlide++ == slides.length-1)
            { 
                curSlide = 0;
            }

        }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;a href="/assets/2009/8/20/Slideshow.zip"&gt;Download the full source&lt;/a&gt; everything you need that we just did in these 4 steps, including the latest greensock tweening engine&lt;br /&gt;
it is better to download the latest &lt;em&gt;*gs&lt;/em&gt;* library from the greensock site because there are frequent updates.&lt;/p&gt;

&lt;p&gt;that’s it for this tutorial. what you now have is a working slideshow that loops. 
once you have a good understanding of this simple process, it should be pretty simple to make minor modifications.&lt;br /&gt;
i suggest you try this tutorial first, download the source, and play with it. change the constants that we defined at the top to make the delay and animation speeds more to your liking. and also explore different easing methods like Quint.easeIn, Quart.easeOut, Sine.easeInOut. etc.  &lt;/p&gt;

&lt;p&gt;then if you want to add more features like user interaction / control, or better and easier management and loading of images for massive photo sets, or preloading, then post your requests in the comments below.&lt;/p&gt;

&lt;p&gt;now here’s a picture of my cat.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;
          &lt;img src="http://feeds.feedburner.com/~r/RemixTechnologyFeed/~4/uvyVn--Pc2Y" height="1" width="1"/&gt;</content>  <feedburner:origLink>http://remixtechnology.com/view/flash-actionscript3-tutorial-animated-slideshow</feedburner:origLink></entry>
  <entry xml:base="http://remixtechnology.com/">
    <author>
      <name>theRemix</name>
    </author>
    <id>tag:remixtechnology.com,2009-08-19:45372</id>
    <published>2009-08-19T20:23:00Z</published>
    <updated>2009-08-19T20:29:45Z</updated>
    <category term="actionscript3" />
    <category term="haxe" />
    <category term="source" />
    <link href="http://feedproxy.google.com/~r/RemixTechnologyFeed/~3/EI9FAAaEiF8/deeptrace-haxe" rel="alternate" type="text/html" />
    <title>deepTrace for haXe flash9/10</title>
<summary type="html">&lt;p&gt;posted a code snippet on &lt;a href="http://haxe.org/doc/snip/deeptrace?lang=en"&gt;http://haxe.org/doc/snip/deeptrace?lang=en&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;a useful tool i use sometimes to see a displayObject’s display list in a tree format with optional parameter to see extra fields.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;deepTrace(myObject,[“x”,”y”]);&lt;/strong&gt;
will trace something like&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;[object myObject] -&amp;gt; ( x : 560; y : 150 )
    [object MovieClip] -&amp;gt; ( x : 0; y : -50 )
        [object Shape] -&amp;gt; ( x : 0; y : 0 )
        [object Shape] -&amp;gt; ( x : 0; y : 0 )
        [object Sprite] -&amp;gt; ( x : 200; y : 100 )
    [object Sprite] -&amp;gt; ( x : 100 ; y : 300 )
        [object SimpleButton] -&amp;gt; ( x : -10 ; y : 100 )
        [object TextField] -&amp;gt; ( x : -40 ; y : -30 )
    [object Sprite] -&amp;gt; ( x : 300 ; y : 300 )
        [object SimpleButton] -&amp;gt; ( x : -10 ; y : 100 )
        [object TextField] -&amp;gt; ( x : -40 ; y : -30 )
    [object Sprite] -&amp;gt; ( x : 200 ; y : 300 )
        [object CustomButton] -&amp;gt; ( x : -37 ; y : 100 )
            [object Shape] -&amp;gt; ( x : 0; y : 0 )
            [object TextField] -&amp;gt; ( x : 0 ; y : 0 )
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;a href="/view/deepTrace-haXe"&gt;view source code&lt;/a&gt;&lt;/p&gt;</summary><content type="html">
            &lt;p&gt;posted a code snippet on &lt;a href="http://haxe.org/doc/snip/deeptrace?lang=en"&gt;http://haxe.org/doc/snip/deeptrace?lang=en&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;a useful tool i use sometimes to see a displayObject’s display list in a tree format with optional parameter to see extra fields.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;deepTrace(myObject,[“x”,”y”]);&lt;/strong&gt;
will trace something like&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;[object myObject] -&amp;gt; ( x : 560; y : 150 )
    [object MovieClip] -&amp;gt; ( x : 0; y : -50 )
        [object Shape] -&amp;gt; ( x : 0; y : 0 )
        [object Shape] -&amp;gt; ( x : 0; y : 0 )
        [object Sprite] -&amp;gt; ( x : 200; y : 100 )
    [object Sprite] -&amp;gt; ( x : 100 ; y : 300 )
        [object SimpleButton] -&amp;gt; ( x : -10 ; y : 100 )
        [object TextField] -&amp;gt; ( x : -40 ; y : -30 )
    [object Sprite] -&amp;gt; ( x : 300 ; y : 300 )
        [object SimpleButton] -&amp;gt; ( x : -10 ; y : 100 )
        [object TextField] -&amp;gt; ( x : -40 ; y : -30 )
    [object Sprite] -&amp;gt; ( x : 200 ; y : 300 )
        [object CustomButton] -&amp;gt; ( x : -37 ; y : 100 )
            [object Shape] -&amp;gt; ( x : 0; y : 0 )
            [object TextField] -&amp;gt; ( x : 0 ; y : 0 )
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;a href="/view/deepTrace-haXe"&gt;view source code&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;deepTrace any displayObject, and add optional fields to trace&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;deepTrace will trace the object and all it’s children.&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;import flash.display.DisplayObject;
import flash.display.DisplayObjectContainer;
import flash.Error;

public static function deepTrace( obj:DisplayObject, ?fields:Array&amp;lt;String&amp;gt;, level:Int = 0 ):Void
{
    var tabs:String = "";
    var i:Int = 0;
    var l:Int = level;
    for ( i in 0...l){
        tabs += "\t";
    }

    var printData = function(newField, fieldString)
    {
        return fieldString + (fieldString != "" ? "; " : "") +newField+ " : " +Reflect.field(obj, newField);
    }
    if(fields != null &amp;amp;&amp;amp; fields.length &amp;gt; 0){
        try{
            trace(tabs + obj + " -&amp;gt; ( " + Lambda.fold(fields, printData, "") + " )");
        }catch(e:Error){
            trace(tabs + obj + " -&amp;gt; ( has no fields ["+fields+"] )");
        }
    }

    if(Std.is(obj,DisplayObjectContainer)){
        for ( i in 0...Reflect.field(obj, "numChildren") ){
            deepTrace( Reflect.field(obj, "getChildAt")(i), fields, level + 1 );
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;h2&gt;deepTrace(myObject,[“x”,”y”]);&lt;/h2&gt;

&lt;p&gt;will trace something like&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;[object myObject] -&amp;gt; ( x : 560; y : 150 )
    [object MovieClip] -&amp;gt; ( x : 0; y : -50 )
        [object Shape] -&amp;gt; ( x : 0; y : 0 )
        [object Shape] -&amp;gt; ( x : 0; y : 0 )
        [object Sprite] -&amp;gt; ( x : 200; y : 100 )
    [object Sprite] -&amp;gt; ( x : 100 ; y : 300 )
        [object SimpleButton] -&amp;gt; ( x : -10 ; y : 100 )
        [object TextField] -&amp;gt; ( x : -40 ; y : -30 )
    [object Sprite] -&amp;gt; ( x : 300 ; y : 300 )
        [object SimpleButton] -&amp;gt; ( x : -10 ; y : 100 )
        [object TextField] -&amp;gt; ( x : -40 ; y : -30 )
    [object Sprite] -&amp;gt; ( x : 200 ; y : 300 )
        [object CustomButton] -&amp;gt; ( x : -37 ; y : 100 )
            [object Shape] -&amp;gt; ( x : 0; y : 0 )
            [object TextField] -&amp;gt; ( x : 0 ; y : 0 )
&lt;/code&gt;&lt;/pre&gt;
          &lt;img src="http://feeds.feedburner.com/~r/RemixTechnologyFeed/~4/EI9FAAaEiF8" height="1" width="1"/&gt;</content>  <feedburner:origLink>http://remixtechnology.com/view/deeptrace-haxe</feedburner:origLink></entry>
  <entry xml:base="http://remixtechnology.com/">
    <author>
      <name>theRemix</name>
    </author>
    <id>tag:remixtechnology.com,2009-07-21:45333</id>
    <published>2009-07-21T06:32:00Z</published>
    <updated>2009-08-10T04:55:46Z</updated>
    <link href="http://feedproxy.google.com/~r/RemixTechnologyFeed/~3/7QGT7F_lopQ/synthesizing_at_lovefest" rel="alternate" type="text/html" />
    <title>Synthesizing at LoveFest</title>
<summary type="html">&lt;p&gt;This is me, 2 years ago in Final Fantasy XI&lt;br /&gt;
&lt;a href="/view/synthesizing_at_lovefest"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is me on Saturday night&lt;br /&gt;
&lt;a href="/view/synthesizing_at_lovefest"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="/view/synthesizing_at_lovefest"&gt;added a video of my light show, watch it here&lt;/a&gt;&lt;/p&gt;</summary><content type="html">
            &lt;p&gt;This is me, 2 years ago in Final Fantasy XI&lt;br /&gt;
&lt;a href="/view/synthesizing_at_lovefest"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is me on Saturday night&lt;br /&gt;
&lt;a href="/view/synthesizing_at_lovefest"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="/view/synthesizing_at_lovefest"&gt;added a video of my light show, watch it here&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Love Fest 09 was awesome. Positive vibe. Great music. Fun night.&lt;/p&gt;

&lt;p&gt;

You need &lt;a href="http://get.adobe.com/flashplayer/" title="Get Flash"&gt;Flash 10&lt;/a&gt; to view the awesome. It’s a free and fast upgrade.
&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/p&gt;

&lt;p&gt;I just realized that the first two photos looked like these:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/p&gt;

&lt;p&gt;Synthesizing crystals to make stuff in FFXI. at LoveFest, i ”&lt;em&gt;made&lt;/em&gt;” a couple free bottles of water, and a lollipop.&lt;/p&gt;
          &lt;img src="http://feeds.feedburner.com/~r/RemixTechnologyFeed/~4/7QGT7F_lopQ" height="1" width="1"/&gt;</content>  <feedburner:origLink>http://remixtechnology.com/view/synthesizing_at_lovefest</feedburner:origLink></entry>
  <entry xml:base="http://remixtechnology.com/">
    <author>
      <name>theRemix</name>
    </author>
    <id>tag:remixtechnology.com,2009-06-16:45323</id>
    <published>2009-06-16T02:25:00Z</published>
    <updated>2009-06-16T03:10:36Z</updated>
    <category term="game" />
    <category term="toy" />
    <category term="video" />
    <link href="http://feedproxy.google.com/~r/RemixTechnologyFeed/~3/GI4_uIsU6Wc/june-gaming-update" rel="alternate" type="text/html" />
    <title>Gaming Update</title>
<content type="html">
            &lt;p&gt;Haven’t posted anything in a long time cause I’ve been busy working on non-games (angry face).&lt;/p&gt;

&lt;p&gt;I’ll be finishing up my rails project this month, then I’ll be back to working on Coconut Kickball. But before i launch the first version of Coconut Kickball, we’re going to enter a submission to the &lt;a href="http://www.mochiads.com/contest/may09"&gt;Mochi May flash game contest sponsored by Dictionary.com&lt;/a&gt;. The game is in planning stages, and it’s going to create a buzz.&lt;/p&gt;

&lt;p&gt;This, all in June.&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;For now, I’d like to post about &lt;a href="http://www.scribblenauts.com/"&gt;SCRIBBLENAUTS&lt;/a&gt;&lt;br /&gt;
if you haven’t heard of this handheld game yet, here’s what critics have said about scribblenauts:&lt;br /&gt;
(from &lt;a href="http://en.wikipedia.org/wiki/Scribblenauts"&gt;wikipedia&lt;/a&gt;)  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Scribblenauts was named the overall &lt;em&gt;“Best of Show”&lt;/em&gt; by &lt;em&gt;Gamespot&lt;/em&gt;, &lt;em&gt;Gamespy&lt;/em&gt;, and &lt;em&gt;IGN&lt;/em&gt;, in addition to other awards.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;1UP.com&lt;/em&gt; named Scribblenauts their E3’s &lt;em&gt;“Most Innovative” title&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;X-Play&lt;/em&gt; gave the game its E3 &lt;em&gt;“Best Original Game”&lt;/em&gt; and “Best Handheld Game” awards.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Ars Technica&lt;/em&gt; considered the game as the show’s &lt;em&gt;“Most Pleasant Surprise”&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;Scribblenauts is the first portable video game to merit &lt;em&gt;“Best of Show”&lt;/em&gt; awards from E3.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;and here’s why:&lt;br /&gt;
&lt;strong&gt;God vs. The Kraken&lt;/strong&gt;  &lt;/p&gt;

&lt;div&gt;         &lt;div&gt;&lt;div&gt;&lt;a href="http://www.gametrailers.com" title="GameTrailers.com"&gt;Video Games&lt;/a&gt; | &lt;a href="http://www.gametrailers.com/user-movie/scribblenauts-god-vs-the/320265" title="Scribblenauts - God vs The Kraken"&gt;Scribblenauts - God vs The Kraken&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.gametrailers.com/platformlist/xb360/index.html" title="XBox 360"&gt;XBox 360&lt;/a&gt; | &lt;a href="http://www.gametrailers.com/platformlist/ps3/index.html" title="PS3"&gt;Playstation 3&lt;/a&gt; | &lt;a href="http://www.gametrailers.com/platformlist/wii/index.html" title="Wii"&gt;Nintendo Wii&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;quote from neogaf&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;I had played all the big titles at E3. Private showings of God of War III, 
Heavy Rain, Alan Wake. But at 4:00 on Thursday, I was wondering around the show floor, 
wondering what else I had to see. I saw a small little booth for "Scribblenauts!" 
in the Warner Bros. Interactive Entertainment section. 
I mean, who goes to that booth? But I remember hearing about it on GAF, 
and so I decided to check it out.

Best game of E3? Without a *****ng doubt. 
Anyone who says otherwise did not play Scribblenauts. 
Best game of all time? Jesus Christ, I don't know, maybe. 
It's a game that challenges your IMAGINATION. 
No other game has ever done that.

So listen to this story. I was in the early levels; 
I didn't quite have an idea of how ridiculously in-depth the database was. 
I was summoning things like ladders, glasses of water, rayguns, what have you. 
But I reached a level with zombie robots, and the zombie robots kept killing me. 
Rayguns didn't work, a torch didn't work, a pickaxe didn't work. In my frustration, 
I wrote in "Time Machine". And one popped up. What the ****? A smile dawned on my face. 
I hopped in, and the option was given to me to either travel to the past or the future. 
I chose past. When I hopped out, there were *****ng dinosaurs walking around. 
I clicked one, and realized I could RIDE THEM. So I hopped on a *****ng DINOSAUR, 
traveled back to the present, and stomped the shit out of robot zombies. 
Did you just read that sentence?
Did you really? 
I *****NG TRAVELED THROUGH TIME AND JUMPED ON A DINOSAUR AND USED IT 
TO KILL MOTHER*****NG ROBOT ZOMBIES.
This game is unbelievable. Impossible. There's nothing you can't do.

Holy *****ng shit.
&lt;/code&gt;&lt;/pre&gt;

&lt;hr /&gt;

&lt;p&gt;This isn’t actually the FIRST video-game/video-toy of this kind that I’ve come across, where it challenges you to use your imagination, remember &lt;a href="http://www.garrysmod.com/"&gt;Garry’s Mod&lt;/a&gt;?  I’ve had many hours stolen from me creating awesome constructions and situations within the &lt;a href="http://en.wikipedia.org/wiki/Source_%28game_engine%29"&gt;Source Engine&lt;/a&gt;. Scribblenauts is a different &lt;strong&gt;kind&lt;/strong&gt; of omfgcrazy fun exciting imaginative experience because you can spawn sooo many different things, and pretty much anything can happen.&lt;/p&gt;
          &lt;img src="http://feeds.feedburner.com/~r/RemixTechnologyFeed/~4/GI4_uIsU6Wc" height="1" width="1"/&gt;</content>  <feedburner:origLink>http://remixtechnology.com/view/june-gaming-update</feedburner:origLink></entry>
  <entry xml:base="http://remixtechnology.com/">
    <author>
      <name>theRemix</name>
    </author>
    <id>tag:remixtechnology.com,2009-05-12:45320</id>
    <published>2009-05-12T23:33:00Z</published>
    <updated>2009-05-16T20:05:44Z</updated>
    <link href="http://feedproxy.google.com/~r/RemixTechnologyFeed/~3/Yi2inUs2ZmM/even-fairy-tale-characters-would-be-jealous" rel="alternate" type="text/html" />
    <title>Even fairy tale characters would be jealous</title>
<content type="html">
            &lt;p&gt;My new iPhone Wallpaper&lt;/p&gt;

&lt;p&gt;&lt;a href="/assets/2009/5/16/fairytale-wallpaper.jpg"&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href="/assets/2009/5/12/fairytale.jpg"&gt;full res&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="/mp3s/Even Fairy Tale Characters Would Be Jealous.mp3"&gt;PlayRadioPlay! - Even Fairy Tale Characters Would Be Jealous.mp3 (full, awesome 8bit 2nd half)&lt;/a&gt;&lt;br /&gt;
&lt;a href="/mp3s/Even Fairy Tale Characters Would Be Jealous - short.mp3"&gt;PlayRadioPlay! - Even Fairy Tale Characters Would Be Jealous.mp3 (short)&lt;/a&gt;&lt;/p&gt;
          &lt;img src="http://feeds.feedburner.com/~r/RemixTechnologyFeed/~4/Yi2inUs2ZmM" height="1" width="1"/&gt;</content>  <feedburner:origLink>http://remixtechnology.com/view/even-fairy-tale-characters-would-be-jealous</feedburner:origLink></entry>
  <entry xml:base="http://remixtechnology.com/">
    <author>
      <name>theRemix</name>
    </author>
    <id>tag:remixtechnology.com,2009-04-07:45309</id>
    <published>2009-04-07T21:17:00Z</published>
    <updated>2009-05-12T23:53:58Z</updated>
    <category term="game" />
    <category term="haxe" />
    <link href="http://feedproxy.google.com/~r/RemixTechnologyFeed/~3/1s-uszd0zr0/my-brute" rel="alternate" type="text/html" />
    <title>My Brute</title>
<content type="html">
            &lt;p&gt;A fun addicting game made entirely in &lt;a href="/tags/haXe"&gt;haXe&lt;/a&gt; by &lt;a href="http://www.motion-twin.com/english"&gt;MotionTwin&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://theRemix.mybrute.com"&gt;Challenge My Brute!&lt;br /&gt;
&lt;/a&gt;&lt;/p&gt;
          &lt;img src="http://feeds.feedburner.com/~r/RemixTechnologyFeed/~4/1s-uszd0zr0" height="1" width="1"/&gt;</content>  <feedburner:origLink>http://remixtechnology.com/view/my-brute</feedburner:origLink></entry>
  <entry xml:base="http://remixtechnology.com/">
    <author>
      <name>theRemix</name>
    </author>
    <id>tag:remixtechnology.com,2009-04-03:45306</id>
    <published>2009-04-03T04:20:00Z</published>
    <updated>2009-04-03T04:30:48Z</updated>
    <category term="haXe Projects" />
    <category term="actionscript3" />
    <category term="game" />
    <category term="haxe" />
    <category term="source" />
    <category term="tutorial" />
    <link href="http://feedproxy.google.com/~r/RemixTechnologyFeed/~3/lMzJlh91ryo/turkey-haxe-game-source-code" rel="alternate" type="text/html" />
    <title>Turkey haXe game Source Code</title>
<summary type="html">&lt;p&gt;requested by Raf&lt;/p&gt;

&lt;p&gt;crude source code, never thought anyone else would see it after i finished, including myself.&lt;/p&gt;

&lt;p&gt;248 lines in the main class. i also created a few supporting classes for this game that i’ve been reusing ever since, and included in my common library.&lt;/p&gt;</summary><content type="html">
            &lt;p&gt;requested by Raf&lt;/p&gt;

&lt;p&gt;crude source code, never thought anyone else would see it after i finished, including myself.&lt;/p&gt;

&lt;p&gt;248 lines in the main class. i also created a few supporting classes for this game that i’ve been reusing ever since, and included in my common library.&lt;/p&gt;
&lt;p&gt;requested by Raf&lt;/p&gt;

&lt;p&gt;crude source code, never thought anyone else would see it after i finished, including myself.&lt;/p&gt;

&lt;p&gt;248 lines in the main class. i also created a few supporting classes for this game that i’ve been reusing ever since, and included in my common library.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;comments&lt;/em&gt;&lt;br /&gt;
the haxe compile file  &lt;/p&gt;

&lt;h2&gt;compile.hxml&lt;/h2&gt;

&lt;pre&gt;&lt;code&gt;-swf main.swf
-swf-version 9
-swf-header 550:500:300:FFFFFF
-main TurkeyHaXe
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;em&gt;comments&lt;/em&gt;&lt;br /&gt;
 the main class  &lt;/p&gt;

&lt;h2&gt;TurkeyHaXe.hx&lt;/h2&gt;

&lt;pre&gt;&lt;code&gt;import com.remixtechnology.GraphicsLoader;
import flash.Lib;
import flash.display.Stage;
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.utils.Timer;
import flash.events.TimerEvent;
import flash.ui.Mouse;
import flash.text.TextField;
import flash.text.TextFormat;

class TurkeyHaXe
{
    public var stage:Stage;
    public var bg_layer:Sprite;
    public var game_layer:Sprite;
    public var over_layer:Sprite;
    private var start_but:Button;
    //private var high_scores_but:Button;
    private var play_again_but:Button;
    private var game_bg:Sprite;
    private var intro_bg:Sprite;
    private var instructions:Sprite;

    private var score:Int;
    private var scoreBoard:ShadowedTextField;
    private var finalScoreBoard:ShadowedTextField;

    private var control:Sprite;
    private var stuffing:Array&amp;lt;Sprite&amp;gt;;
    private var stuffing_graphics:Array&amp;lt;GraphicsLoader&amp;gt;;
    private var fail_graphics:Array&amp;lt;Sprite&amp;gt;;
    private var fail_message:Sprite;
    private var drop_interval:Int; //seconds //current
    private var drop_timer:Timer;
    private var drops:Int;
    private var first_time:Bool;
    private var drop_speed:Float;

    public static function main() {
        new TurkeyHaXe();
    }
    private function new(){
        stage = Lib.current.stage;
        init();
    }
    private function init(){
        //make layers
        bg_layer = new Sprite();
        stage.addChild(bg_layer);
        game_layer = new Sprite();
        stage.addChild(game_layer);
        over_layer = new Sprite();
        stage.addChild(over_layer);

        stuffing = new Array&amp;lt;Sprite&amp;gt;();
        stuffing_graphics = new Array&amp;lt;GraphicsLoader&amp;gt;();
        fail_graphics = new Array&amp;lt;Sprite&amp;gt;();

        score = 0;

        //show start screen
        intro_bg = new GraphicsLoader(Settings.graphics_path + "intro_bg.png").sprite;
        bg_layer.addChild(intro_bg);

        start_but = new Button("intro_start_but.png", "intro_start_but_over_bg.png");
        over_layer.addChild(start_but);
        start_but.addEventListener(MouseEvent.CLICK, click_start_but);
        //start_but.x = 300;
        //start_but.y = 210;
        start_but.x = 200;
        start_but.y = 130;

        /*
        high_scores_but = new Button("intro_high_scores_but.png", "intro_high_scores_but_over_bg.png");
        over_layer.addChild(high_scores_but);
        high_scores_but.x = 260;
        high_scores_but.y = 260;
        start_but.addEventListener(MouseEvent.CLICK, click_high_scores_but); */

        //gimme stuffing
        stuffing_graphics.push(new GraphicsLoader(Settings.graphics_path + "stuffing_0.png"));
        stuffing_graphics.push(new GraphicsLoader(Settings.graphics_path + "stuffing_1.png"));
        stuffing_graphics.push(new GraphicsLoader(Settings.graphics_path + "stuffing_2.png"));

        //gimme fail
        fail_graphics.push(new GraphicsLoader(Settings.graphics_path + "fail_0.png").sprite);
        fail_graphics.push(new GraphicsLoader(Settings.graphics_path + "fail_1.png").sprite);
        fail_graphics.push(new GraphicsLoader(Settings.graphics_path + "fail_2.png").sprite);
        fail_graphics.push(new GraphicsLoader(Settings.graphics_path + "fail_3.png").sprite);
        fail_graphics.push(new GraphicsLoader(Settings.graphics_path + "fail_4.png").sprite);
        fail_graphics.push(new GraphicsLoader(Settings.graphics_path + "fail_5.png").sprite);
        fail_graphics.push(new GraphicsLoader(Settings.graphics_path + "fail_6.png").sprite);

        first_time = true;
    }
    private function click_start_but(_):Void{
        loadGame();
    }
    private function click_high_scores_but(_):Void{
        //showHighScores();
    }
    private function loadGame():Void{
        drop_interval = Settings.init_drop_interval;
        drop_timer = new Timer(drop_interval);
        drop_timer.addEventListener(TimerEvent.TIMER, tick_drop);
        drop_timer.start();

        drop_speed = Settings.init_drop_speed;

        control = new GraphicsLoader(Settings.graphics_path + "control.png").sprite;
        game_layer.addChild(control);
        control.y = 360;

        stage.addEventListener(MouseEvent.MOUSE_MOVE, stage_mouse_move);
        stage.addEventListener(Event.ENTER_FRAME, loop);

        if(first_time){ 
            clear_intro();
            game_bg = new GraphicsLoader(Settings.graphics_path + "game_bg.png").sprite;
            bg_layer.addChild(game_bg);
            showInstructions(); 
            scoreBoard = new ShadowedTextField();
            over_layer.addChild(scoreBoard);
            scoreBoard.x = 15;
            scoreBoard.y = 15;
        }
        score = 0;
        scoreBoard.setText(Std.string(score));
        if(Settings.hide_cursor) {Mouse.hide();}
    }
    private function setDropTimer():Void{
        drop_timer.stop();
        drop_timer.removeEventListener(TimerEvent.TIMER, tick_drop);
        drop_timer = null;
        drop_timer = new Timer(drop_interval);
        drop_timer.addEventListener(TimerEvent.TIMER, tick_drop);
        drop_timer.start();
    }
    private function tick_drop(_):Void{
        var randX:Int = Math.round(Math.random()*(stage.stageWidth-80))+30;
        var randS:Int = Math.floor(Math.random()*stuffing_graphics.length);
        var s:Sprite = new Sprite();
        game_layer.addChild(s);
        stuffing_graphics[randS].getCopySprite(s);
        stuffing.push(s);
        s.x = randX;
        s.y = -10;
        s.rotation = Math.round(Math.random()*360);
        drops++;
        if((drops % Settings.increment_drop_speed_every) == 0){
            drop_speed += Settings.increment_drop_speed;
        }
        if( ((drops % Settings.increment_drop_every) == 0) &amp;amp;&amp;amp; drop_interval &amp;gt; Settings.min_drop_interval){
            drop_interval -= Settings.increment_drop_interval;
            setDropTimer();
        }
    }
    private function showInstructions():Void{
        var t:Timer = new Timer(3000,1);
        t.addEventListener(TimerEvent.TIMER_COMPLETE, complete_instructions);
        t.start();

        instructions = new GraphicsLoader(Settings.graphics_path + "catch_all_the_stuffing.png").sprite;
        over_layer.addChild(instructions);
        instructions.x = 65;
        instructions.y = 100;

        first_time = false;
    }
    private function complete_instructions(_):Void{
        over_layer.removeChild(instructions);
        instructions = null;
    }
    private function stage_mouse_move(_):Void{
        control.x = stage.mouseX - 40;
    }
    private function loop(_):Void{
        var s:Sprite;
        for(s in stuffing){
            s.y += drop_speed;
            if(s.y &amp;gt;= stage.stageHeight){
                gameOver();
            }else if(s.hitTestPoint(stage.mouseX, 410)){
                stuffing.remove(s);
                game_layer.removeChild(s);
                s = null;
                awardPoints();
            }
        }
    }
    private function clear_intro():Void{
        start_but.parent.removeChild(start_but);
        //high_scores_but.parent.removeChild(high_scores_but);
        intro_bg.parent.removeChild(intro_bg);
        start_but = null;
        //high_scores_but = null;
        intro_bg = null;
    }
    private function awardPoints():Void{
        score += drops + Math.round(drop_speed) + (Settings.init_drop_interval - drop_interval);
        scoreBoard.setText(Std.string(score));
    }
    private function gameOver():Void{
        drop_timer.removeEventListener(TimerEvent.TIMER, tick_drop);
        drop_timer.stop();

        game_layer.removeChild(control);
        control = null;

        var s:Sprite;
        for(s in stuffing){
            game_layer.removeChild(s);
        }

        stuffing = new Array&amp;lt;Sprite&amp;gt;();

        stage.removeEventListener(MouseEvent.MOUSE_MOVE, stage_mouse_move);
        stage.removeEventListener(Event.ENTER_FRAME, loop);

        if(Settings.hide_cursor) {Mouse.show();}

        // show fail message
        var randF:Int = Math.floor(Math.random()*fail_graphics.length);
        fail_message = new Sprite();
        game_layer.addChild(fail_message);
        fail_message.addChild(fail_graphics[randF]);
        fail_message.x = 40;
        fail_message.y = 80;

        // show try again
        play_again_but = new Button("try_again_but.png", "try_again_but_over_bg.png");
        over_layer.addChild(play_again_but);
        play_again_but.x = 150;
        play_again_but.y = 420;
        play_again_but.addEventListener(MouseEvent.CLICK, try_again_click);
    }
    private function try_again_click(_):Void{
        game_layer.removeChild(fail_message);
        fail_message = null;
        play_again_but.removeEventListener(MouseEvent.CLICK, try_again_click);
        over_layer.removeChild(play_again_but);
        play_again_but = null;
        loadGame();
    }

}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;em&gt;comments&lt;/em&gt;&lt;br /&gt;
a very simple class that loads an external image. i found this class to be very very handy, but is by no means perfect. part of the com.remixtechnology package.  &lt;/p&gt;

&lt;h2&gt;GraphicsLoader.hx&lt;/h2&gt;

&lt;pre&gt;&lt;code&gt;/* loads a graphic (at runtime), returns a Sprite with that graphic in it using getSprite() */
package com.remixtechnology;
import flash.display.Loader;
import flash.display.Sprite;
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.events.Event;
import flash.events.IOErrorEvent;
import flash.net.URLRequest;
class GraphicsLoader{
    private var fileName:String;
    private var bm:Bitmap;
    private var ldr:Loader;
    private var copies:Array&amp;lt;Sprite&amp;gt;;
    public var sprite:Sprite;
    public var loaded:Bool;
    public function new(_fileName:String){
        fileName = _fileName;
        init();
    }
    private function init():Void{
        loaded = false;
        sprite = new Sprite();
        copies = new Array();
        ldr = new Loader();
        ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, loader_complete);
        ldr.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loader_ioError);
        ldr.load(new URLRequest(fileName));
    }
    private function loader_ioError(event:IOErrorEvent):Void{
        trace("ioErrorHandler: " + event.text);
        trace("Could not load: " + fileName);
    }
    private function loader_complete(event:Event):Void{
        loaded = true;
        bm = event.target.content;
        sprite.addChild(bm);
        if(copies.length &amp;gt; 0){
            var i:Sprite;
            for(i in copies){
                copySprite(i);
            }
        }
    }
    public function getCopySprite(emptySprite:Sprite):Void{ // gets a copy of the sprite, 
        // but leaves the original alone
        // take an emptySprite, and promise to attach a bitmap when it's done loading
        // track promises using the array 'copies'
        // unless it's already loaded, then just get a copy
        if(loaded){
            copySprite(emptySprite);
        }else{
            copies.push(emptySprite);
        }
    }
    private function copySprite(s:Sprite):Void{
        var data:BitmapData = new BitmapData(Std.int(bm.width), Std.int(bm.height), true, 0);
        data.draw(bm);
        var bitmap:Bitmap = new Bitmap(data);
        s.addChild(bitmap); // promise fulfilled
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;em&gt;comments&lt;/em&gt;&lt;br /&gt;
a simple button class that extends Sprite, all it really does is load a couple of graphics to create a rollover state. lines 12 and 13 are little hacks because of the way i exported my graphics. in the newest version of this class, the rollover is a nice fading tween, and of course lines 12 and 13 are not there. and this class has been added to the com.remixtechnology package.  &lt;/p&gt;

&lt;h2&gt;Button.hx&lt;/h2&gt;

&lt;pre&gt;&lt;code&gt;import com.remixtechnology.GraphicsLoader;
import flash.display.Sprite;
import flash.events.MouseEvent;
class Button extends Sprite{
    private var normal_state:Sprite;
    private var over_state:Sprite;
    public function new(normal_state_path:String, over_state_path:String){
        normal_state = new GraphicsLoader(Settings.graphics_path + normal_state_path).sprite;
        over_state = new GraphicsLoader(Settings.graphics_path + over_state_path).sprite;
        addChild(over_state);
        addChild(normal_state);
        normal_state.x = 15;
        normal_state.y = 6;
        over_state.visible = false;
        addListeners();
        super();
    }
    private function addListeners():Void{
        addEventListener(MouseEvent.MOUSE_OVER, mouseOver);
        addEventListener(MouseEvent.MOUSE_OUT, mouseOut);
    }
    private function mouseOver(_):Void{
        over_state.visible = true;
    }
    private function mouseOut(_):Void{
        over_state.visible = false;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;em&gt;comments&lt;/em&gt;
a simple text field class that i use a lot, this version is not very customizable, but i’ve added it to the com.remixtechnology package and made it a lot more customizable with some decent default settings. here i use it to display the score, but i use it a lot for tracing because if you add graphics to the stage, like in this game, it covers haXe’s trace messages.  &lt;/p&gt;

&lt;h2&gt;ShadowedTextField.hx&lt;/h2&gt;

&lt;pre&gt;&lt;code&gt;import flash.display.Sprite;
import flash.text.TextField;
import flash.text.TextFieldAutoSize;
import flash.text.TextFormat;

class ShadowedTextField extends Sprite
{

    private var fgColor:UInt;
    private var bgColor:UInt;
    private var xoff:Float;
    private var yoff:Float;

    private var tfFore:TextField;
    private var tfBack:TextField;
    private var fmtFore:TextFormat;
    private var fmtBack:TextFormat;

    private var size:Int;
    private var font:String;

    public function new()
    {
        bgColor = 0x000000;
        fgColor = Settings.font_color;
        xoff = 1;
        yoff = 1;
        size = 24;
        font = 'Verdana';

        mouseChildren = false;
        mouseEnabled = false;

        tfBack = new TextField();
        tfBack.autoSize = TextFieldAutoSize.LEFT;
        tfBack.selectable = false;
        tfBack.x = xoff;
        tfBack.y = yoff;
        addChild(tfBack);

        tfFore = new TextField();
        tfFore.autoSize = TextFieldAutoSize.LEFT;
        tfFore.selectable = false;
        addChild(tfFore);

        fmtFore = new TextFormat();
        fmtFore.color = fgColor;
        fmtFore.size = size;
        fmtFore.font = font;
        fmtFore.bold = true;

        fmtBack = new TextFormat();
        fmtBack.color = bgColor;
        fmtBack.size = size;
        fmtBack.font = font;
        fmtBack.bold = true;

        super();
    }

    public function setText(n:String):Void
    {
        tfFore.text = n;
        tfFore.setTextFormat(fmtFore);

        tfBack.text = n;
        tfBack.setTextFormat(fmtBack);
    }

}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;em&gt;comments&lt;/em&gt;&lt;br /&gt;
some settings for the game, not sure why i left it out of the main class, i guess i just wanted a quick way to access some static settings from any class. i think it’s unnecessary, and i don’t do this anymore.  &lt;/p&gt;

&lt;h2&gt;Settings.hx&lt;/h2&gt;

&lt;pre&gt;&lt;code&gt;class Settings{
    public static var hide_cursor:Bool = false;
    //local
    public static var graphics_path:String = "graphics/";
    //on remixtechnology
    //public static var graphics_path:String = "/haXe/turkey_haXe/graphics/";
    public static var init_drop_interval:Int = 1500;
    public static var increment_drop_interval:Int = 50;
    public static var increment_drop_every:Int = 3;
    public static var min_drop_interval:Int = 300;
    public static var init_drop_speed:Float = 4;
    public static var increment_drop_speed:Float = .25;
    public static var increment_drop_speed_every:Float = 5;

    public static var font_color:UInt = 0xffa312;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;and finally, here is the zip file complete with all assets, everything that i used to create this simple game.&lt;/p&gt;

&lt;p&gt;&lt;a href="/downloads/turkey_haXe_source.zip"&gt;Download the entire source + assets (3.8 Mb)&lt;/a&gt;&lt;/p&gt;
          &lt;img src="http://feeds.feedburner.com/~r/RemixTechnologyFeed/~4/lMzJlh91ryo" height="1" width="1"/&gt;</content>  <feedburner:origLink>http://remixtechnology.com/view/turkey-haxe-game-source-code</feedburner:origLink></entry>
</feed>
