How to Remove Spaces from a String

Removing spaces from a string is really easy in Actionscript 3. One method is to simply convert the string to an array using the String.split() function using a space as the delimiter. Then you can use the Array.join function to put it all back together again without the spaces.

Comic-Con 2011 Can Kiss My Ass

I realize that this is completely off subject, but I am so pissed at Comic-con that I must rant.

First of all, there are just too many people, period. I went to the convention for the first time about 4 years ago, and there were a lot of people then. I had no problems getting into see my favorite panels back then. It was quite an enjoyable experience which I recommended to all of my friends!

A Simple Pause Function in Actionscript 3

Just a quick function that you can use in your library of tricks to simulate pausing in Actionscript 3.

1
2
3
4
5
6
7
8
9
10
11
public static function pause(timeInSeconds:int, functionToCall:Function):void {
    var timer:Timer = new Timer(timeInSeconds * 1000);
    timer.addEventListener(TimerEvent.TIMER, callFunction, false, 0, true);
    timer.start();
    function callFunction(event:TimerEvent):void {
        timer.stop();
        timer.removeEventListener(TimerEvent.TIMER, callFunction);
        timer = null;
        functionToCall();              
    }
}

The function takes 2 arguments:

timeInSeconds – how many seconds to wait before calling the function
functionToCall – the function to call after the given time has passed