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.
Here is a simple function that will do the trick:
var split:Array = input.split(" ");
var output:String = split.join("");
// outputs: ABCDEFGHIJKLMNOPQRSTUVWXYZ