<?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 - haXe Projects</title>
  <id>tag:remixtechnology.com,2011:mephisto/haXe</id>
  <generator uri="http://mephistoblog.com" version="0.8.0">Mephisto Drax</generator>
  
  <link href="http://remixtechnology.com/haXe" rel="alternate" type="text/html" />
  <updated>2010-01-13T22:19:07Z</updated>
  <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/remixtechnology-on-haXe" /><feedburner:info uri="remixtechnology-on-haxe" /><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,2010-01-13:45588</id>
    <published>2010-01-13T20:54:00Z</published>
    <updated>2010-01-13T22:19:07Z</updated>
    <category term="haXe Projects" />
    <category term="3d" />
    <category term="actionscript3" />
    <category term="audio" />
    <category term="benchmark" />
    <category term="flash" />
    <category term="haxe" />
    <category term="sandy" />
    <category term="source" />
    <category term="toy" />
    <link href="http://feedproxy.google.com/~r/remixtechnology-on-haXe/~3/-wbEOP5UCYk/swfprofiler_haxe" rel="alternate" type="text/html" />
    <title>SWFProfiler haXe'd</title>
<summary type="html">&lt;p&gt;I ported over a very good SWFProfiler that a fellow actionscripter wrote over a year ago.&lt;br /&gt;
It’s very useful especially to &lt;a href="/tags/haXe"&gt;haXe&lt;/a&gt;‘rs when all we have to play with is the flash debug player, and for flash game devs to make sure our framerates stay up, and our memory is managed correctly.  &lt;/p&gt;

&lt;p&gt;I added &lt;a href="http://1.bp.blogspot.com/_y2OQguXcEvo/R_1a8QDkN4I/AAAAAAAAAA4/pZ1qz9BrLMk/S760/I%2BHas%2BA%2BFlavor.jpg"&gt;my own flavor&lt;/a&gt; to this already awesome SWFProfiler.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;made the line graph move from right to left instead of left to right.&lt;/li&gt;
&lt;li&gt;added additional colors to the line graph to show dips and spikes in technicolor 3d imax hd blu-ray&lt;/li&gt;
&lt;li&gt;added an optional object inspector that traces out objects and properties&lt;/li&gt;
&lt;li&gt;added a garbage collector to force gc()&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="/view/SWFProfiler_haXe"&gt;See the demo and download the source.&lt;/a&gt;&lt;/p&gt;</summary><content type="html">
            &lt;p&gt;I ported over a very good SWFProfiler that a fellow actionscripter wrote over a year ago.&lt;br /&gt;
It’s very useful especially to &lt;a href="/tags/haXe"&gt;haXe&lt;/a&gt;‘rs when all we have to play with is the flash debug player, and for flash game devs to make sure our framerates stay up, and our memory is managed correctly.  &lt;/p&gt;

&lt;p&gt;I added &lt;a href="http://1.bp.blogspot.com/_y2OQguXcEvo/R_1a8QDkN4I/AAAAAAAAAA4/pZ1qz9BrLMk/S760/I%2BHas%2BA%2BFlavor.jpg"&gt;my own flavor&lt;/a&gt; to this already awesome SWFProfiler.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;made the line graph move from right to left instead of left to right.&lt;/li&gt;
&lt;li&gt;added additional colors to the line graph to show dips and spikes in technicolor 3d imax hd blu-ray&lt;/li&gt;
&lt;li&gt;added an optional object inspector that traces out objects and properties&lt;/li&gt;
&lt;li&gt;added a garbage collector to force gc()&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="/view/SWFProfiler_haXe"&gt;See the demo and download the source.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I ported over a very good SWFProfiler that a fellow actionscripter wrote over a year ago.&lt;br /&gt;
It’s very useful especially to &lt;a href="/tags/haXe"&gt;haXe&lt;/a&gt;‘rs when all we have to play with is the flash debug player, and for flash game devs to make sure our framerates stay up, and our memory is managed correctly.  &lt;/p&gt;

&lt;p&gt;original author shanem (Shane McCartney) &lt;a href="http://www.lostinactionscript.com/blog/index.php/2008/10/06/as3-swf-profiler/"&gt;as3-swf-profiler&lt;/a&gt;  &lt;/p&gt;

&lt;p&gt;I added &lt;a href="http://1.bp.blogspot.com/_y2OQguXcEvo/R_1a8QDkN4I/AAAAAAAAAA4/pZ1qz9BrLMk/S760/I%2BHas%2BA%2BFlavor.jpg"&gt;my own flavor&lt;/a&gt; to this already awesome SWFProfiler.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;made the line graph move from right to left instead of left to right.&lt;/li&gt;
&lt;li&gt;added additional colors to the line graph to show dips and spikes in technicolor 3d imax hd blu-ray&lt;/li&gt;
&lt;li&gt;added an optional object inspector that traces out objects and properties&lt;/li&gt;
&lt;li&gt;added a garbage collector to force gc()&lt;/li&gt;
&lt;/ul&gt;

&lt;pre&gt;&lt;code&gt;
Usage: SWFProfiler.init( ?inspector_object_starting_point:Dynamic );  
Right-Click / Command-Click on the stage after SWFProfiler has been initialized.  
Choose "Show Profiler" to open the SWFProfiler  
Choose "Garbage Collector" to force gc().  
if SWFProfiler is visible, choose "Hide Profiler" to remove it from stage.  

Initialize without optional parameter: SWFProfiler.init();  
Will disable the Inspector function.  

To Enable the Inspector function, pass an object as the starting point to trace from.  
SWFProfiler.init(this);  

in the inspector textinput, use standard dot notation starting from the object passed  
 "field" or "object.field" or "object.object.field"  

the value of the field will display in the inspector value box (right half) if it exists  
the text in the inspector textinput will turn red if the field/object does not exist
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;enjoy flash swf profiling right-clicky graphing charting lining tracing fpsing haXing inlining juicy madness alpha zero point five goodness…&lt;/p&gt;

&lt;p&gt;&lt;a href="/com/remixtechnology/SWFProfiler.hx"&gt;download SWFProfiler.hx&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;Demo&lt;/h3&gt;

&lt;p&gt;Click on the swf below to start/stop music.&lt;br /&gt;
Right-Click / Command-Click on the embedded swf to open the ContextMenu&lt;br /&gt;
Choose “Show Profiler” to open the SWFProfiler&lt;br /&gt;
Now i know you are rawkin’ your mom’s dual-core iMac, so you’re probably only seeing really high fps and my leet memory management ninjutsu makes the mem-history line plateau, so to get things moving around in &lt;em&gt;this&lt;/em&gt; demo, you can grab your browser, and shake it like a polaroid picture for 5 seconds, you should see the fps line dip at least into yellow zone.&lt;br /&gt;
Here comes another fun part, i enabled the Inspector by passing my main class as the starting point to trace from. So with the SWFProfiler open, you should see “Inspector: stage.frameRate” to the right of that you will see the current value for that property. my main class has an object defined called stage. and Stage has a property called frameRate.&lt;br /&gt;
You can erase “stage.frameRate” and write whatever you want to inspect. here are some values to test out. just type away, and you’ll see the output as if you actually wrote “trace(object.property);”  &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Objects&lt;/em&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;root&lt;/li&gt;
&lt;li&gt;stage&lt;/li&gt;
&lt;li&gt;scene&lt;/li&gt;
&lt;li&gt;camera&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;some Main class properties&lt;/em&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;curFrame&lt;/li&gt;
&lt;li&gt;ball1&lt;/li&gt;
&lt;li&gt;ball1_orbit_speed ( press right or left key to change )&lt;/li&gt;
&lt;li&gt;ball1_orbit_magnitude&lt;/li&gt;
&lt;li&gt;ball1_orbit_pulsate&lt;/li&gt;
&lt;li&gt;ball1_rotate_speed  ( press up or down key to change )&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;some other fun properties to play with&lt;/em&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;sound.id3.album&lt;/li&gt;
&lt;li&gt;sound.id3.artist&lt;/li&gt;
&lt;li&gt;sound.id3.songName (press 1,2,3,4,5, or 6 to change song)&lt;/li&gt;
&lt;li&gt;sound.id3.year&lt;/li&gt;
&lt;li&gt;transform.volume&lt;/li&gt;
&lt;/ul&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;strong&gt;[up arrow]&lt;/strong&gt; speeds up sphere rotation speed&lt;br /&gt; &lt;strong&gt;[down arrow]&lt;/strong&gt; slows down sphere rotation speed&lt;br /&gt; &lt;strong&gt;[left arrow]&lt;/strong&gt; slows down sphere orbit speed&lt;br /&gt; &lt;strong&gt;[right arrow]&lt;/strong&gt; speeds up sphere orbit speed&lt;br /&gt;&lt;strong&gt;[b]&lt;/strong&gt; toggles background color white|black&lt;br /&gt;   &lt;strong&gt;[SPACEBAR]&lt;/strong&gt; mutes/unmutes the music&lt;br /&gt; &lt;strong&gt;[1]&lt;/strong&gt; plays Enter Shikari - Johnny Sniper (5.5mb)&lt;br /&gt; &lt;strong&gt;[2]&lt;/strong&gt; plays Payami - Sweet Child of Mine (6.6mb)&lt;br /&gt; &lt;strong&gt;[3]&lt;/strong&gt; plays Genki Rockets - Intermediate -Orbit Swimming- (7.6mb)&lt;br /&gt; &lt;strong&gt;[4]&lt;/strong&gt; plays Kaskade - 4 AM (Adam K &amp;amp; Soha Radio Edit) (8.4mb)&lt;br /&gt; &lt;strong&gt;[5]&lt;/strong&gt; plays Shoupz Entertainment - Destroy She Said (Stryder) (4.2mb)&lt;br /&gt; &lt;strong&gt;[6]&lt;/strong&gt; plays DJ Loopy - Follow Me (6.2mb)&lt;/p&gt;

&lt;p&gt;&lt;a href="/com/remixtechnology/SWFProfiler.hx"&gt;download SWFProfiler.hx&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;see source run&lt;br /&gt;
run source run&lt;/p&gt;

&lt;h3&gt;SWFProfiler.hx&lt;/h3&gt;




/**
 * original author shanem (Shane McCartney) http://www.lostinactionscript.com/blog/index.php/2008/10/06/as3-swf-profiler/
 * ported to haXe by theRemix : http://remixtechnology.com
 * demo and source : http://remixtechnology.com/view/SWFProfiler_haXe
 *
 * Usage: SWFProfiler.init( ?inspector_object_starting_point:Dynamic );
 * Right-Click / Command-Click on the stage after SWFProfiler has been initialized.
 * Choose “Show Profiler” to open the SWFProfiler
 * Choose “Garbage Collector” to force gc().
 * if SWFProfiler is visible, choose “Hide Profiler” to remove it from stage.
 *
 * Initialize without optional parameter: SWFProfiler.init();
 * Will disable the Inspector function.
 *  
 * To Enable the Inspector function, pass an object as the starting point to trace from.
 * SWFProfiler.init(this);
 * 
 * in the inspector textinput, use standard dot notation starting from the object passed
 *  “field” or “object.field” or “object.object.field”
 *
 * the value of the field will display in the inspector value box (right half) if it exists
 * the text in the inspector textinput will turn red if the field/object does not exist
 * 
 */

package com.remixtechnology;
import flash.Lib;
import flash.Error;
import flash.display.Stage;
import flash.display.Sprite;
import flash.display.Graphics;
import flash.display.InteractiveObject;
import flash.display.Shape;
import flash.text.TextField;
import flash.text.TextFormat;
import flash.text.TextFieldAutoSize;
import flash.events.Event;
import flash.events.FocusEvent;
import flash.events.ContextMenuEvent;
import flash.events.EventDispatcher;
import flash.net.LocalConnection;
import flash.system.System;
import flash.ui.ContextMenu;
import flash.ui.ContextMenuItem;
import haxe.Timer;

class SWFProfiler {
    private static var itvTime : Int;
    private static var initTime : Int;
    private static var currentTime : Int;
    private static var frameCount : Int;
    private static var totalCount : Int;

    public static var minFps : Int;
    public static var maxFps : Int;
    public static var minMem : Float;
    public static var maxMem : Float;
    public static var history : Int = 60;
    public static var fpsList : Array = new Array();
    public static var memList : Array = new Array();

    public static var displayed : Bool = false;
    private static var started : Bool = false;
    private static var inited : Bool = false;
    private static var frame : Sprite;
    private static var stage : Stage;
    private static var content : ProfilerContent;
    private static var ci : ContextMenuItem;
    private static var gc_ci: ContextMenuItem;

    public static inline function init(?main = null) : Void {
        if(!inited){
            inited = true;
            stage = Lib.current.stage;
            content = new ProfilerContent(main);
            frame = new Sprite();
            minFps = maxFps = 0;
            maxMem = 0;
            minMem = currentMem;

            var cm : ContextMenu = new ContextMenu();
            cm.hideBuiltInItems();
            ci = new ContextMenuItem(“Show Profiler”, true);
            ci.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, select_ci, false, 0, true);
            gc_ci = new ContextMenuItem(“Garbage Collector”);
            gc_ci.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, select_gc_ci, false, 0, true);
            cm.customItems = [ci,gc_ci];
            flash.Lib.current.contextMenu = cm;

            start();
        }
    }

    public static inline function start() : Void {
        if(!started){
            started = true;
            initTime = itvTime = Std.int(Timer.stamp());
            totalCount = frameCount = 0;
            frame.addEventListener(Event.ENTER_FRAME, frameLoop, false, 0, true);
        }
    }

    public static inline function stop() : Void {
        if(!started){
            started = false;
            frame.removeEventListener(Event.ENTER_FRAME, frameLoop);
        }
    }

    public static var currentFps:Int;

    public static var currentMem(get_currentMem, never):Float;
    public static inline function get_currentMem() : Float {
        return (System.totalMemory / 1024) / 1000;
    }

    public static var averageFps(get_averageFps, never):Float;
    public static inline function get_averageFps() : Float {
        return totalCount / runningTime;
    }

    public static var runningTime(get_runningTime, never):Float;
    private static inline function get_runningTime() : Float {
        return (currentTime - initTime) ;
    }

    public static var intervalTime(get_intervalTime, never):Float;
    private static inline function get_intervalTime() : Float {
        return (currentTime - itvTime);
    }


    private static inline function select_ci(_) : Void {
        if(!displayed) {
            show();
        } else {
            hide();
        }
    }

    private static inline function select_gc_ci(_) : Void {
        System.gc();
        System.gc(); // i always see people do it twice
    }

    private static inline function show() : Void {
        ci.caption = “Hide Profiler”;
        displayed = true;
        stage.addEventListener(Event.RESIZE, resize, false, 0, true);
        stage.addChild(content);
        updateDisplay();
    }

    private static inline function hide() : Void {
        ci.caption = “Show Profiler”;
        displayed = false;
        stage.removeEventListener(Event.RESIZE, resize);
        stage.removeChild(content);
    }

    private static inline function resize(e:Event) : Void {
        content.update(runningTime, minFps, maxFps, minMem, maxMem, currentFps, currentMem, averageFps, fpsList, memList, history);
    }

    private static inline function frameLoop(_) : Void {
        currentTime = Std.int(Timer.stamp());
        frameCount++;
        totalCount++;

        if(intervalTime &gt;= 1) {
            currentFps = frameCount;

            if(displayed) {
                updateDisplay();
            } else {
                updateMinMax();
            }
            fpsList.push(currentFps);
            memList.push(currentMem);

            if(fpsList.length &gt; history) fpsList.shift();
            if(memList.length &gt; history) memList.shift();

            itvTime = currentTime;
            frameCount = 0;
        }
    }

    private static inline function updateDisplay() : Void {
        updateMinMax();
        content.update(runningTime, minFps, maxFps, minMem, maxMem, currentFps, currentMem, averageFps, fpsList, memList, history);
    }

    private static inline function updateMinMax() : Void {
        maxFps = Std.int(Math.max(currentFps, maxFps));

        minMem = Math.min(currentMem, minMem);
        maxMem = Math.max(currentMem, maxMem);
    }
}


class ProfilerContent extends Sprite {

    private static inline var FPS_LINE_COLOR_HIGH = 0x33FF00;
    private static inline var FPS_LINE_COLOR_NORMAL = 0xFFEE33;//0x0099CC;
    private static inline var FPS_LINE_COLOR_LOW = 0xFF3333;
    private static inline var MEM_LINE_COLOR_LOW = 0x00CCFF;
    private static inline var MEM_LINE_COLOR_NORMAL = 0xFFEE33;//0x336699;
    private static inline var MEM_LINE_COLOR_HIGH = 0xFF3366;

    private var fpsLabel: TextField;
    private var minFpsTxtBx : TextField;
    private var maxFpsTxtBx : TextField;
    private var minMemTxtBx : TextField;
    private var maxMemTxtBx : TextField;
    private var memLabel: TextField;
    private var infoTxtBx : TextField;
    private var inspectLabel : TextField;
    private var inspectInputTxt : TextField;
    private static inline var exists_tf : TextFormat = new TextFormat(“_sans”, 9, 0x99CCFF);
    private static inline var undefined_tf : TextFormat = new TextFormat(“_sans”, 9, 0xFF88AA);
    private static inline var tf : TextFormat = new TextFormat(“_sans”, 9, 0xCCCCCC);
    private var box : Shape;
    private var fps : Shape;
    private var mb : Shape;
    private var main: Dynamic;
    private var boxHeight: Int;

    public function new(?_main:Dynamic = null) : Void {
        super();
        fps = new Shape();
        mb = new Shape();
        box = new Shape();
        main = _main;

        //this.mouseChildren = (main==null)?false:true; // not necessary
        this.mouseEnabled = false;

        fps.x = 65;
        fps.y = 45; 
        mb.x = 65;
        mb.y = 90;
        boxHeight = (main==null)?100:120;

        minFpsTxtBx = new TextField();
        minFpsTxtBx.autoSize = TextFieldAutoSize.RIGHT;
        minFpsTxtBx.defaultTextFormat = tf;
        minFpsTxtBx.x = 60;
        minFpsTxtBx.y = 37;
        minFpsTxtBx.mouseEnabled = false;

        maxFpsTxtBx = new TextField();
        maxFpsTxtBx.autoSize = TextFieldAutoSize.RIGHT;
        maxFpsTxtBx.defaultTextFormat = tf;
        maxFpsTxtBx.x = 60;
        maxFpsTxtBx.y = 5;
        maxFpsTxtBx.mouseEnabled = false;

        fpsLabel = new TextField();
        fpsLabel.autoSize = TextFieldAutoSize.RIGHT;
        fpsLabel.defaultTextFormat = tf;
        fpsLabel.x = 50;
        fpsLabel.y = 16;
        fpsLabel.mouseEnabled = false;

        minMemTxtBx = new TextField();
        minMemTxtBx.autoSize = TextFieldAutoSize.RIGHT;
        minMemTxtBx.defaultTextFormat = tf;
        minMemTxtBx.x = 60;
        minMemTxtBx.y = 83;
        minMemTxtBx.mouseEnabled = false;

        maxMemTxtBx = new TextField();
        maxMemTxtBx.autoSize = TextFieldAutoSize.RIGHT;
        maxMemTxtBx.defaultTextFormat = tf;
        maxMemTxtBx.x = 60;
        maxMemTxtBx.y = 50;
        maxMemTxtBx.mouseEnabled = false;

        memLabel = new TextField();
        memLabel.autoSize = TextFieldAutoSize.RIGHT;
        memLabel.defaultTextFormat = tf;
        memLabel.x = 55;
        memLabel.y = 66;
        memLabel.mouseEnabled = false;

        addChild(box);
        addChild(fpsLabel);
        addChild(minFpsTxtBx);
        addChild(maxFpsTxtBx);
        addChild(memLabel);
        addChild(minMemTxtBx);
        addChild(maxMemTxtBx);
        addChild(fps);
        addChild(mb);

        if(main != null){
            infoTxtBx = new TextField();
            infoTxtBx.autoSize = TextFieldAutoSize.LEFT;
            infoTxtBx.defaultTextFormat = new TextFormat(“_sans”, 11, 0xCCCCCC);
            infoTxtBx.y = 98;
            infoTxtBx.x = 290;
            infoTxtBx.mouseEnabled = false;

            inspectLabel = new TextField();
            inspectLabel.autoSize = TextFieldAutoSize.LEFT;
            inspectLabel.defaultTextFormat = tf;
            inspectLabel.text = “Inspect Object :”;
            inspectLabel.x = 7;
            inspectLabel.y = 98;
            inspectLabel.mouseEnabled = false;

            inspectInputTxt = new TextField();
            inspectInputTxt.type = flash.text.TextFieldType.INPUT;
            inspectInputTxt.defaultTextFormat = exists_tf;
            inspectInputTxt.text = “stage.frameRate”;
            inspectInputTxt.x = 80;
            inspectInputTxt.y = 98;
            inspectInputTxt.width = 200;
            inspectInputTxt.height = 18;
            inspectInputTxt.mouseEnabled = true;

            addChild(infoTxtBx);
            addChild(inspectLabel);
            addChild(inspectInputTxt);
        }

        this.addEventListener(Event.ADDED_TO_STAGE, added, false, 0, true);
        this.addEventListener(Event.REMOVED_FROM_STAGE, removed, false, 0, true);
    }

    public inline function update(runningTime : Float, minFps : Int, maxFps : Int, minMem : Float, maxMem : Float, currentFps : Int, currentMem : Float, averageFps : Float, fpsList : Array, memList : Array, history : Int) : Void {
        if(runningTime &gt;= 1 &amp;&amp; maxMem &gt; 0) {
            minFpsTxtBx.text = Std.string(minFps);
            maxFpsTxtBx.text = Std.string(maxFps);
            minMemTxtBx.text = Std.string(minMem);
            maxMemTxtBx.text = Std.string(maxMem);
        }

        fpsLabel.text = Std.int(currentFps) + ” FPS\n” + Std.int(averageFps) + ” Avg”;
        memLabel.text = currentMem + ” Mb”;

        if(main != null) updateInspector();

        var vec : Graphics = fps.graphics;
        vec.clear();

        var i : Int = 0;
        var len : Int = fpsList.length;
        var height : Int = 35;
        var width : Int = stage.stageWidth - 80;
        var inc : Float = width / (history - 1);
        var rateRange : Float = maxFps - minFps;
        var value : Float;

        for(i in 0…len) {
            value = (fpsList[i] - minFps) / rateRange;
            vec.lineStyle(1, 
                if(value&amp;lt;=.7){
                    FPS_LINE_COLOR_LOW;
                }else if(value&gt;=.9){
                    FPS_LINE_COLOR_HIGH;
                }else{
                    FPS_LINE_COLOR_NORMAL;
                }, 0.7);
            if(i == 0) {
                vec.moveTo(width- (len-1-i) * inc, -value * height);
            } else {
                vec.lineTo(width- (len-1-i) * inc, -value * height);
            }
        }

        vec = mb.graphics;
        vec.clear();

        i = 0;
        len = memList.length;
        rateRange = maxMem - minMem;
        for(i in 0…len) {
            value = (memList[i] - minMem) / rateRange;
            vec.lineStyle(1, 
                if(value&amp;lt;=.6){
                    MEM_LINE_COLOR_LOW;
                }else if(value&gt;=.95){
                    MEM_LINE_COLOR_HIGH;
                }else{
                    MEM_LINE_COLOR_NORMAL;
                }, 0.7);
            if(i == 0) {
                vec.moveTo(width- (len-1-i) * inc, -value * height);
            } else {
                vec.lineTo(width- (len-1-i) * inc, -value * height);
            }
        }
    }

    private inline function updateInspector(  ):Void
    {
        var obj:Dynamic = main;
        var obj_ar:Array = inspectInputTxt.text.split(“.”);

        if(inspectInputTxt.text.lastIndexOf(“.”) &gt; 0){
            for(i in 0…obj_ar.length){
                if(Reflect.hasField(obj, obj_ar[i])){
                    if(i &amp;lt; obj_ar.length-1){
                        inspectInputTxt.defaultTextFormat = exists_tf;
                        obj = Reflect.field(obj, obj_ar[i]);
                    }else{
                        if(Reflect.hasField(obj, obj_ar[i])){
                            inspectInputTxt.defaultTextFormat = exists_tf;
                            infoTxtBx.text = Reflect.field(obj, obj_ar[i]);
                        }
                    }
                    inspectInputTxt.text = inspectInputTxt.text;
                }else{
                    inspectInputTxt.defaultTextFormat = undefined_tf;
                    infoTxtBx.text = "";
                    inspectInputTxt.text = inspectInputTxt.text;
                    break;
                }
            }
        }else{
            if(Reflect.hasField(main,inspectInputTxt.text)){
                infoTxtBx.text = Reflect.field(main, inspectInputTxt.text);
                inspectInputTxt.defaultTextFormat = exists_tf;
            }else{
                inspectInputTxt.defaultTextFormat = undefined_tf;
                infoTxtBx.text = "";
            }
            inspectInputTxt.text = inspectInputTxt.text;
        }

    }

    private inline function added(e : Event) : Void {
        resize();
        stage.addEventListener(Event.RESIZE, resize, false, 0, true);
    }

    private inline function removed(e : Event) : Void {
        stage.removeEventListener(Event.RESIZE, resize);
    }

    private inline function resize(e : Event = null) : Void {
        var vec : Graphics = box.graphics;
        vec.clear();

        vec.beginFill(0x000000, 0.7);
        vec.drawRect(0, 0, stage.stageWidth, boxHeight);
        vec.lineStyle(1, 0xFFFFFF, 0.5);

        vec.moveTo(65, 45);
        vec.lineTo(65, 10);
        vec.moveTo(65, 45);
        vec.lineTo(stage.stageWidth - 15, 45);

        vec.moveTo(65, 90);
        vec.lineTo(65, 55);
        vec.moveTo(65, 90);
        vec.lineTo(stage.stageWidth - 15, 90);

        vec.endFill();
    }
}

          &lt;img src="http://feeds.feedburner.com/~r/remixtechnology-on-haXe/~4/-wbEOP5UCYk" height="1" width="1"/&gt;</content>  <feedburner:origLink>http://remixtechnology.com/view/swfprofiler_haxe</feedburner:origLink></entry>
  <entry xml:base="http://remixtechnology.com/">
    <author>
      <name>theRemix</name>
    </author>
    <id>tag:remixtechnology.com,2009-12-23:45518</id>
    <published>2009-12-23T23:24:00Z</published>
    <updated>2009-12-23T23:28:31Z</updated>
    <category term="haXe Projects" />
    <category term="game" />
    <category term="haxe" />
    <link href="http://feedproxy.google.com/~r/remixtechnology-on-haXe/~3/153lvSbxVZ8/play_santas_sack" rel="alternate" type="text/html" />
    <title>Play Santa's Sack</title>
<content type="html">
            &lt;h1&gt;Merry Christmas!&lt;/h1&gt;

&lt;h2&gt;2009 Christmas haXe Game&lt;/h2&gt;

&lt;p&gt;Our gift to you, 2009 Christmas game made with love and &lt;a href="/tags/haXe"&gt;haXe&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://playsantassack.com"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://playsantassack.com"&gt;http://playsantassack.com&lt;/a&gt;&lt;/p&gt;
          &lt;img src="http://feeds.feedburner.com/~r/remixtechnology-on-haXe/~4/153lvSbxVZ8" height="1" width="1"/&gt;</content>  <feedburner:origLink>http://remixtechnology.com/view/play_santas_sack</feedburner:origLink></entry>
  <entry xml:base="http://remixtechnology.com/">
    <author>
      <name>theRemix</name>
    </author>
    <id>tag:remixtechnology.com,2009-11-27:45432</id>
    <published>2009-11-27T11:38:00Z</published>
    <updated>2009-12-01T01:00:28Z</updated>
    <category term="haXe Projects" />
    <category term="game" />
    <category term="haxe" />
    <link href="http://feedproxy.google.com/~r/remixtechnology-on-haXe/~3/pm16eyVHNpo/play_thanksgiving_kitchen_hero" rel="alternate" type="text/html" />
    <title>Play Thanksgiving Kitchen Hero</title>
<summary type="html">&lt;h2&gt;Oh yes, another Thanksgiving game for the 09&lt;/h2&gt;

&lt;p&gt;This is the most fun and most original, and not a clone, and it’s very hard… like some turkeys.
click to enjoy pumpkinstyle!&lt;/p&gt;

&lt;p&gt;&lt;a href="/view/play_thanksgiving_kitchen_hero"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;i love making games in a day… this game took longer than &lt;a href="/view/turkey_haxe"&gt;last years&lt;/a&gt;, we hope you like.&lt;/p&gt;</summary><content type="html">
            &lt;h2&gt;Oh yes, another Thanksgiving game for the 09&lt;/h2&gt;

&lt;p&gt;This is the most fun and most original, and not a clone, and it’s very hard… like some turkeys.
click to enjoy pumpkinstyle!&lt;/p&gt;

&lt;p&gt;&lt;a href="/view/play_thanksgiving_kitchen_hero"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;i love making games in a day… this game took longer than &lt;a href="/view/turkey_haxe"&gt;last years&lt;/a&gt;, we hope you like.&lt;/p&gt;
&lt;h2&gt;Happy Thanksgiving 2009&lt;/h2&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;a href="/tags/haXe"&gt;haXe&lt;/a&gt; &lt;a href="/tags/game"&gt;game&lt;/a&gt; in a day!, &lt;em&gt;* If the game doesn’t fit in your browser, press F11 to get more vertical space&lt;/em&gt;*&lt;/p&gt;

&lt;p&gt;created by me&lt;br /&gt;
and illustrated entirely by &lt;a href="http://pnpnt.com"&gt;pnpnt&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;here is last year’s Thanksgiving game in a day: &lt;a href="/view/turkey_haxe"&gt;Turkey haXe - Thanksgiving 08&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;synopsis&lt;/strong&gt;&lt;br /&gt;
Thanksgiving Food Fight!&lt;br /&gt;
Fast paced food battle of skill and reflexes.&lt;br /&gt;
Throw pumpkins at turkeys to knock it to your opponents side of the kitchen. Your opponent throws pies at turkeys, don’t let the turkeys get past your side of the kitchen!&lt;br /&gt;
Guaranteed to not be a clone of any game ever made.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;instructions&lt;/strong&gt;&lt;br /&gt;
Click anywhere to send your pumpkins flying across the kitchen in that direction. Your ammo is displayed on the bottom right corner. If any pies or pumpkins go between the kitchen counter tops on the bottom of the screen, or explode on your half of the kitchen, you get another pumpkin for ammo.&lt;br /&gt;
You win by getting 2 (out of 3) turkeys across the kitchen and between the counter tops on the top side of the screen.&lt;br /&gt;
If you win, Play Again to play against a tougher opponent. The enemies quickly get smarter and faster as you progress through the levels.&lt;/p&gt;
          &lt;img src="http://feeds.feedburner.com/~r/remixtechnology-on-haXe/~4/pm16eyVHNpo" height="1" width="1"/&gt;</content>  <feedburner:origLink>http://remixtechnology.com/view/play_thanksgiving_kitchen_hero</feedburner:origLink></entry>
  <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/remixtechnology-on-haXe/~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/remixtechnology-on-haXe/~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/remixtechnology-on-haXe/~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/remixtechnology-on-haXe/~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/remixtechnology-on-haXe/~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/remixtechnology-on-haXe/~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/remixtechnology-on-haXe/~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/remixtechnology-on-haXe/~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/remixtechnology-on-haXe/~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/remixtechnology-on-haXe/~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/remixtechnology-on-haXe/~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/remixtechnology-on-haXe/~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-04-03:45306</id>
    <published>2009-04-03T04:20:00Z</published>
    <updated>2010-01-05T17:10:12Z</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/remixtechnology-on-haXe/~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;full source for &lt;a href="/view/turkey_haxe"&gt;Turkey haXe&lt;/a&gt;&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;</summary><content type="html">
            &lt;p&gt;full source for &lt;a href="/view/turkey_haxe"&gt;Turkey haXe&lt;/a&gt;&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;full source for &lt;a href="/view/turkey_haxe"&gt;Turkey haXe&lt;/a&gt;&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/remixtechnology-on-haXe/~4/lMzJlh91ryo" height="1" width="1"/&gt;</content>  <feedburner:origLink>http://remixtechnology.com/view/turkey-haxe-game-source-code</feedburner:origLink></entry>
  <entry xml:base="http://remixtechnology.com/">
    <author>
      <name>theRemix</name>
    </author>
    <id>tag:remixtechnology.com,2009-04-01:45303</id>
    <published>2009-04-01T01:28:00Z</published>
    <updated>2009-04-03T00:16:14Z</updated>
    <category term="haXe Projects" />
    <category term="game" />
    <category term="haxe" />
    <link href="http://feedproxy.google.com/~r/remixtechnology-on-haXe/~3/F-WmTJmhym0/ie6-game" rel="alternate" type="text/html" />
    <title>Internet Explorer 6 Sim Game</title>
<summary type="html">&lt;p&gt;A quick game that Werd and I came up with.&lt;br /&gt;
This is a sim-type puzzle game.&lt;br /&gt;
&lt;a href="/view/IE6-Game"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You are a web developer at your local #4 web developing company. You have to build a website that is compatible with Internet Explorer 6 because that is what your client’s use in their office. Try to keep your job and finish your work in a timely manner.&lt;/p&gt;

&lt;p&gt;There are 4 levels in this game so far.&lt;/p&gt;</summary><content type="html">
            &lt;p&gt;A quick game that Werd and I came up with.&lt;br /&gt;
This is a sim-type puzzle game.&lt;br /&gt;
&lt;a href="/view/IE6-Game"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You are a web developer at your local #4 web developing company. You have to build a website that is compatible with Internet Explorer 6 because that is what your client’s use in their office. Try to keep your job and finish your work in a timely manner.&lt;/p&gt;

&lt;p&gt;There are 4 levels in this game so far.&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;Instructions&lt;/em&gt;&lt;br /&gt;
For the first few seconds, you’ll see the website design that you must build. The creative department was nice enough to cut up the HTML elements for you to just drag and drop into everyone’s favorite WYSIWYG IDE: Front Page 97.&lt;br /&gt;
Then the timer will start. Drag and drop the elements from your assets directory on the right, to the WYSIWYG IDE on the left. Position the element correctly.  Now you should test it for IE6 by pressing the big IE6 icon (or press &lt;strong&gt;[ENTER]&lt;/strong&gt; to toggle). Go back to your IDE by pressing the icon again or the &lt;strong&gt;[ENTER]&lt;/strong&gt; key, and reposition the element so that it will look better in IE6. Keep switching between IE6 preview and your IDE until it looks right. Then drag and drop the next element in.
If you forget how the comp looks, hit the &lt;strong&gt;Preview&lt;/strong&gt; button at the top (or press &lt;strong&gt;[SPACEBAR]&lt;/strong&gt; to toggle).&lt;br /&gt;
If you have time, you can fine tune the element positioning by nudging them, hit &lt;strong&gt;[UP ARROW] [DOWN ARROW] [LEFT ARROW]&lt;/strong&gt; and &lt;strong&gt;[RIGHT ARROW]&lt;/strong&gt;  &lt;/p&gt;

&lt;p&gt;When you are satisfied with how it looks in IE6, send your work to your boss for review by clicking the big Outlook Express icon.&lt;br /&gt;
Be aware the deadline, if time runs out, you lose automatically. So just turn in what you got and maybe you won’t lose.  &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Scoring&lt;/em&gt;&lt;br /&gt;
Valid Markup: How close your layout looks like the designer’s comp.&lt;br /&gt;
Deadline Bonus: Amount of time left, minus a penalty for unused page elements  &lt;/p&gt;

&lt;p&gt;Front Page 97 is a little buggy, so if you find any bugs, please post them in comments.  &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Post your scores below&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Sincerely,&lt;br /&gt;
The Bobs&lt;/p&gt;
          &lt;img src="http://feeds.feedburner.com/~r/remixtechnology-on-haXe/~4/F-WmTJmhym0" height="1" width="1"/&gt;</content>  <feedburner:origLink>http://remixtechnology.com/view/ie6-game</feedburner:origLink></entry>
  <entry xml:base="http://remixtechnology.com/">
    <author>
      <name>theRemix</name>
    </author>
    <id>tag:remixtechnology.com,2009-03-12:45289</id>
    <published>2009-03-12T22:18:00Z</published>
    <updated>2009-03-21T02:44:08Z</updated>
    <category term="haXe Projects" />
    <category term="3d" />
    <category term="actionscript3" />
    <category term="animation" />
    <category term="audio" />
    <category term="benchmark" />
    <category term="haxe" />
    <category term="sandy" />
    <category term="toy" />
    <link href="http://feedproxy.google.com/~r/remixtechnology-on-haXe/~3/GR7ELAmFLNM/sandy-31-haxe-spectrum-analyzer-disco-variation" rel="alternate" type="text/html" />
    <title>Sandy 3.1 haXe Spectrum Analyzer (Disco variation)</title>
<summary type="html">&lt;p&gt;This variation adds random colors when the spheres pulsate.&lt;br /&gt;same fps and memory displays exist, they are just hidden, use the keys to view them if you want.&lt;br /&gt;also using haXe compiler flag -D SANDY_USE_FAST_MATH&lt;/p&gt;
&lt;p&gt;&lt;a href="/view/sandy-31-haXe-spectrum-analyzer-disco-variation"&gt;&lt;/a&gt;&lt;/p&gt;</summary><content type="html">
            &lt;p&gt;This variation adds random colors when the spheres pulsate.&lt;br /&gt;same fps and memory displays exist, they are just hidden, use the keys to view them if you want.&lt;br /&gt;also using haXe compiler flag -D SANDY_USE_FAST_MATH&lt;/p&gt;
&lt;p&gt;&lt;a href="/view/sandy-31-haXe-spectrum-analyzer-disco-variation"&gt;&lt;/a&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;p&gt;This variation adds random colors when the spheres pulsate.&lt;br /&gt;same fps and memory displays exist, they are just hidden, use the keys to view them if you want.&lt;br /&gt;also using haXe compiler flag -D SANDY_USE_FAST_MATH&lt;/p&gt;
&lt;p&gt;The song that plays first is Kaskade - 4 AM (Adam K &amp;amp; Soha Radio Edit) (8.4mb)&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;you can change the speed of the sphere rotation and orbit&lt;br /&gt;and toggle the benchmark displays and background color&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;[up arrow]&lt;/strong&gt; speeds up sphere rotation speed&lt;br /&gt; &lt;strong&gt;[down arrow]&lt;/strong&gt; slows down sphere rotation speed&lt;br /&gt; &lt;strong&gt;[left arrow]&lt;/strong&gt; slows down sphere orbit speed&lt;br /&gt; &lt;strong&gt;[right arrow]&lt;/strong&gt; speeds up sphere orbit speed&lt;br /&gt;&lt;strong&gt;[b]&lt;/strong&gt; toggles background color white|black&lt;br /&gt; &lt;strong&gt;[m]&lt;/strong&gt; toggles memory display&lt;br /&gt; &lt;strong&gt;[u]&lt;/strong&gt; forces update of memory&lt;br /&gt; &lt;strong&gt;[f]&lt;/strong&gt; toggles fps meter display&lt;br /&gt; &lt;strong&gt;[SPACEBAR]&lt;/strong&gt; mutes/unmutes the music&lt;br /&gt; &lt;strong&gt;[1]&lt;/strong&gt; plays Enter Shikari - Johnny Sniper (5.5mb)&lt;br /&gt; &lt;strong&gt;[2]&lt;/strong&gt; plays Payami - Sweet Child of Mine (6.6mb)&lt;br /&gt; &lt;strong&gt;[3]&lt;/strong&gt; plays Genki Rockets - Intermediate -Orbit Swimming- (7.6mb)&lt;br /&gt; &lt;strong&gt;[4]&lt;/strong&gt; plays Kaskade - 4 AM (Adam K &amp;amp; Soha Radio Edit) (8.4mb)&lt;br /&gt; &lt;strong&gt;[5]&lt;/strong&gt; plays Shoupz Entertainment - Destroy She Said (Stryder) (4.2mb)&lt;br /&gt; &lt;strong&gt;[6]&lt;/strong&gt; plays DJ Loopy - Follow Me (6.2mb)&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="/view/sandy-31-flash-spectrum-analyzer"&gt;&lt;strong&gt;Flash 10&lt;/strong&gt; (Flash ide)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/view/sandy-31-flex-spectrum-analyzer"&gt;&lt;strong&gt;Flex 3&lt;/strong&gt; (mxmlc)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/view/sandy-31-haXe-spectrum-analyzer"&gt;&lt;strong&gt;haXe 2.02&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/view/sandy-31-haXe-fast-math-spectrum-analyzer"&gt;&lt;strong&gt;haXe 2.02 FAST_MATH&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;please post your scores in the comments. fps, mem, browser, os, cpu, etc. whatever it's fun.&lt;/p&gt;
          &lt;img src="http://feeds.feedburner.com/~r/remixtechnology-on-haXe/~4/GR7ELAmFLNM" height="1" width="1"/&gt;</content>  <feedburner:origLink>http://remixtechnology.com/view/sandy-31-haxe-spectrum-analyzer-disco-variation</feedburner:origLink></entry>
  <entry xml:base="http://remixtechnology.com/">
    <author>
      <name>theRemix</name>
    </author>
    <id>tag:remixtechnology.com,2009-03-10:45287</id>
    <published>2009-03-10T22:16:00Z</published>
    <updated>2009-03-21T02:40:55Z</updated>
    <category term="haXe Projects" />
    <category term="3d" />
    <category term="actionscript3" />
    <category term="animation" />
    <category term="audio" />
    <category term="benchmark" />
    <category term="haxe" />
    <category term="sandy" />
    <category term="toy" />
    <link href="http://feedproxy.google.com/~r/remixtechnology-on-haXe/~3/nYt51lpNySc/sandy-31-haxe-fast-math-spectrum-analyzer" rel="alternate" type="text/html" />
    <title>Sandy 3.1 haXe FastMath Spectrum Analyzer</title>
<summary type="html">&lt;p&gt;&lt;a href="/view/sandy-31-haXe-fast-math-spectrum-analyzer"&gt;&lt;strong&gt;haXe 2.02 FAST_MATH&lt;/strong&gt;&lt;br /&gt; &lt;/a&gt;&lt;/p&gt;</summary><content type="html">
            &lt;p&gt;&lt;a href="/view/sandy-31-haXe-fast-math-spectrum-analyzer"&gt;&lt;strong&gt;haXe 2.02 FAST_MATH&lt;/strong&gt;&lt;br /&gt; &lt;/a&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;p&gt;This version has FastMath enabled for a slight speed increase&lt;br /&gt;using haXe compiler flag -D SANDY_USE_FAST_MATH&lt;/p&gt;
&lt;p&gt;The song that plays first is Kaskade - 4 AM (Adam K &amp;amp; Soha Radio Edit) (8.4mb)&lt;/p&gt;
&lt;p&gt;I added some more controls for fun and benchmarks.&lt;br /&gt;you can change the speed of the sphere rotation and orbit&lt;br /&gt;and toggle the benchmark displays and background color&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;[up arrow]&lt;/strong&gt; speeds up sphere rotation speed&lt;br /&gt; &lt;strong&gt;[down arrow]&lt;/strong&gt; slows down sphere rotation speed&lt;br /&gt; &lt;strong&gt;[left arrow]&lt;/strong&gt; slows down sphere orbit speed&lt;br /&gt; &lt;strong&gt;[right arrow]&lt;/strong&gt; speeds up sphere orbit speed&lt;br /&gt;&lt;strong&gt;[b]&lt;/strong&gt; toggles background color white|black&lt;br /&gt; &lt;strong&gt;[m]&lt;/strong&gt; toggles memory display&lt;br /&gt; &lt;strong&gt;[u]&lt;/strong&gt; forces update of memory&lt;br /&gt; &lt;strong&gt;[f]&lt;/strong&gt; toggles fps meter display&lt;br /&gt; &lt;strong&gt;[SPACEBAR]&lt;/strong&gt; mutes/unmutes the music&lt;br /&gt; &lt;strong&gt;[1]&lt;/strong&gt; plays Enter Shikari - Johnny Sniper (5.5mb)&lt;br /&gt; &lt;strong&gt;[2]&lt;/strong&gt; plays Payami - Sweet Child of Mine (6.6mb)&lt;br /&gt; &lt;strong&gt;[3]&lt;/strong&gt; plays Genki Rockets - Intermediate -Orbit Swimming- (7.6mb)&lt;br /&gt; &lt;strong&gt;[4]&lt;/strong&gt; plays Kaskade - 4 AM (Adam K &amp;amp; Soha Radio Edit) (8.4mb)&lt;br /&gt; &lt;strong&gt;[5]&lt;/strong&gt; plays Shoupz Entertainment - Destroy She Said (Stryder) (4.2mb)&lt;br /&gt; &lt;strong&gt;[6]&lt;/strong&gt; plays DJ Loopy - Follow Me (6.2mb)&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="/view/sandy-31-flash-spectrum-analyzer"&gt;&lt;strong&gt;Flash 10&lt;/strong&gt; (Flash ide)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/view/sandy-31-flex-spectrum-analyzer"&gt;&lt;strong&gt;Flex 3&lt;/strong&gt; (mxmlc)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/view/sandy-31-haXe-spectrum-analyzer"&gt;&lt;strong&gt;haXe 2.02&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/view/sandy-31-haXe-fast-math-spectrum-analyzer"&gt;&lt;strong&gt;haXe 2.02 FAST_MATH&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;please post your scores in the comments. fps, mem, browser, os, cpu, etc. whatever it's fun.&lt;/p&gt;
          &lt;img src="http://feeds.feedburner.com/~r/remixtechnology-on-haXe/~4/nYt51lpNySc" height="1" width="1"/&gt;</content>  <feedburner:origLink>http://remixtechnology.com/view/sandy-31-haxe-fast-math-spectrum-analyzer</feedburner:origLink></entry>
  <entry xml:base="http://remixtechnology.com/">
    <author>
      <name>theRemix</name>
    </author>
    <id>tag:remixtechnology.com,2009-03-10:45288</id>
    <published>2009-03-10T22:16:00Z</published>
    <updated>2009-03-21T02:41:09Z</updated>
    <category term="haXe Projects" />
    <category term="3d" />
    <category term="actionscript3" />
    <category term="animation" />
    <category term="audio" />
    <category term="benchmark" />
    <category term="haxe" />
    <category term="sandy" />
    <category term="toy" />
    <link href="http://feedproxy.google.com/~r/remixtechnology-on-haXe/~3/pljyO-kHKVM/haxe-sandy-3-1-demo-for-mac-pro" rel="alternate" type="text/html" />
    <title>Sandy 3.1 accident for MacPro</title>
<summary type="html">&lt;p&gt;&lt;strong&gt;WARNING, DO NOT VIEW THIS PAGE IF YOU HAVE A SLOW MACHINE&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This version is a special experimental accident that i decided to post because my iMac bogged down to &amp;lt; 8 fps&lt;/p&gt;
&lt;p&gt;i want to see how a MacPro scores&lt;/p&gt;</summary><content type="html">
            &lt;p&gt;&lt;strong&gt;WARNING, DO NOT VIEW THIS PAGE IF YOU HAVE A SLOW MACHINE&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This version is a special experimental accident that i decided to post because my iMac bogged down to &amp;lt; 8 fps&lt;/p&gt;
&lt;p&gt;i want to see how a MacPro scores&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;WARNING, LEAVE THIS PAGE IF YOU HAVE A SLOW MACHINE&lt;/strong&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;p&gt;This version is a special experimental accident that i decided to post because my iMac bogged down to &amp;lt; 8 fps&lt;/p&gt;
&lt;p&gt;i want to see how a MacPro scores&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;[up arrow]&lt;/strong&gt; speeds up sphere rotation speed&lt;br /&gt; &lt;strong&gt;[down arrow]&lt;/strong&gt; slows down sphere rotation speed&lt;br /&gt; &lt;strong&gt;[left arrow]&lt;/strong&gt; slows down sphere orbit speed&lt;br /&gt; &lt;strong&gt;[right arrow]&lt;/strong&gt; speeds up sphere orbit speed&lt;br /&gt;&lt;strong&gt;[b]&lt;/strong&gt; toggles background color white|black&lt;br /&gt; &lt;strong&gt;[m]&lt;/strong&gt; toggles memory display&lt;br /&gt; &lt;strong&gt;[u]&lt;/strong&gt; forces update of memory&lt;br /&gt; &lt;strong&gt;[f]&lt;/strong&gt; toggles fps meter display&lt;br /&gt; &lt;strong&gt;[SPACEBAR]&lt;/strong&gt; mutes/unmutes the music&lt;br /&gt; &lt;strong&gt;[1]&lt;/strong&gt; plays Enter Shikari - Johnny Sniper (5.5mb)&lt;br /&gt; &lt;strong&gt;[2]&lt;/strong&gt; plays Payami - Sweet Child of Mine (6.6mb)&lt;br /&gt; &lt;strong&gt;[3]&lt;/strong&gt; plays Genki Rockets - Intermediate -Orbit Swimming- (7.6mb)&lt;br /&gt; &lt;strong&gt;[4]&lt;/strong&gt; plays Kaskade - 4 AM (Adam K &amp;amp; Soha Radio Edit) (8.4mb)&lt;br /&gt; &lt;strong&gt;[5]&lt;/strong&gt; plays Shoupz Entertainment - Destroy She Said (Stryder) (4.2mb)&lt;br /&gt; &lt;strong&gt;[6]&lt;/strong&gt; plays DJ Loopy - Follow Me (6.2mb)&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="/view/sandy-31-flash-spectrum-analyzer"&gt;&lt;strong&gt;Flash 10&lt;/strong&gt; (Flash ide)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/view/sandy-31-flex-spectrum-analyzer"&gt;&lt;strong&gt;Flex 3&lt;/strong&gt; (mxmlc)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/view/sandy-31-haXe-spectrum-analyzer"&gt;&lt;strong&gt;haXe 2.02&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/view/sandy-31-haXe-fast-math-spectrum-analyzer"&gt;&lt;strong&gt;haXe 2.02 FAST_MATH&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;please post your scores in the comments. fps, mem, browser, os, cpu, etc.&lt;/p&gt;
          &lt;img src="http://feeds.feedburner.com/~r/remixtechnology-on-haXe/~4/pljyO-kHKVM" height="1" width="1"/&gt;</content>  <feedburner:origLink>http://remixtechnology.com/view/haxe-sandy-3-1-demo-for-mac-pro</feedburner:origLink></entry>
  <entry xml:base="http://remixtechnology.com/">
    <author>
      <name>theRemix</name>
    </author>
    <id>tag:remixtechnology.com,2009-03-10:45284</id>
    <published>2009-03-10T22:14:00Z</published>
    <updated>2009-03-21T02:40:38Z</updated>
    <category term="haXe Projects" />
    <category term="3d" />
    <category term="actionscript3" />
    <category term="animation" />
    <category term="audio" />
    <category term="benchmark" />
    <category term="haxe" />
    <category term="sandy" />
    <category term="toy" />
    <link href="http://feedproxy.google.com/~r/remixtechnology-on-haXe/~3/W2cJkPGyMqk/sandy-31-haxe-spectrum-analyzer" rel="alternate" type="text/html" />
    <title>Sandy 3.1 haXe Spectrum Analyzer</title>
<summary type="html">&lt;p&gt;&lt;a href="/view/sandy-31-haXe-spectrum-analyzer"&gt;&lt;strong&gt;haXe 2.02&lt;/strong&gt;&lt;br /&gt; &lt;/a&gt;&lt;/p&gt;</summary><content type="html">
            &lt;p&gt;&lt;a href="/view/sandy-31-haXe-spectrum-analyzer"&gt;&lt;strong&gt;haXe 2.02&lt;/strong&gt;&lt;br /&gt; &lt;/a&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;p&gt;The song that plays first is Kaskade - 4 AM (Adam K &amp;amp; Soha Radio Edit) (8.4mb)&lt;/p&gt;
&lt;p&gt;I added some more controls for fun and benchmarks.&lt;br /&gt;you can change the speed of the sphere rotation and orbit&lt;br /&gt;and toggle the benchmark displays&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;[up arrow]&lt;/strong&gt; speeds up sphere rotation speed&lt;br /&gt; &lt;strong&gt;[down arrow]&lt;/strong&gt; slows down sphere rotation speed&lt;br /&gt; &lt;strong&gt;[left arrow]&lt;/strong&gt; slows down sphere orbit speed&lt;br /&gt; &lt;strong&gt;[right arrow]&lt;/strong&gt; speeds up sphere orbit speed&lt;br /&gt;&lt;strong&gt;[b]&lt;/strong&gt; toggles background color white|black&lt;br /&gt; &lt;strong&gt;[m]&lt;/strong&gt; toggles memory display&lt;br /&gt; &lt;strong&gt;[u]&lt;/strong&gt; forces update of memory&lt;br /&gt; &lt;strong&gt;[f]&lt;/strong&gt; toggles fps meter display&lt;br /&gt; &lt;strong&gt;[SPACEBAR]&lt;/strong&gt; mutes/unmutes the music&lt;br /&gt; &lt;strong&gt;[1]&lt;/strong&gt; plays Enter Shikari - Johnny Sniper (5.5mb)&lt;br /&gt; &lt;strong&gt;[2]&lt;/strong&gt; plays Payami - Sweet Child of Mine (6.6mb)&lt;br /&gt; &lt;strong&gt;[3]&lt;/strong&gt; plays Genki Rockets - Intermediate -Orbit Swimming- (7.6mb)&lt;br /&gt; &lt;strong&gt;[4]&lt;/strong&gt; plays Kaskade - 4 AM (Adam K &amp;amp; Soha Radio Edit) (8.4mb)&lt;br /&gt; &lt;strong&gt;[5]&lt;/strong&gt; plays Shoupz Entertainment - Destroy She Said (Stryder) (4.2mb)&lt;br /&gt; &lt;strong&gt;[6]&lt;/strong&gt; plays DJ Loopy - Follow Me (6.2mb)&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="/view/sandy-31-flash-spectrum-analyzer"&gt;&lt;strong&gt;Flash 10&lt;/strong&gt; (Flash ide)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/view/sandy-31-flex-spectrum-analyzer"&gt;&lt;strong&gt;Flex 3&lt;/strong&gt; (mxmlc)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/view/sandy-31-haXe-spectrum-analyzer"&gt;&lt;strong&gt;haXe 2.02&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/view/sandy-31-haXe-fast-math-spectrum-analyzer"&gt;&lt;strong&gt;haXe 2.02 FAST_MATH&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;please post your scores in the comments. fps, mem, browser, os, cpu, etc. whatever it's fun.&lt;/p&gt;
          &lt;img src="http://feeds.feedburner.com/~r/remixtechnology-on-haXe/~4/W2cJkPGyMqk" height="1" width="1"/&gt;</content>  <feedburner:origLink>http://remixtechnology.com/view/sandy-31-haxe-spectrum-analyzer</feedburner:origLink></entry>
</feed>

