Самый простой способ удалить не только пробелы, но и любые символы в этом отношении, выглядит следующим образом:
//Tested on Flash CS5 and AIR 2.0
//Regular expressions
var spaces:RegExp = / /gi; // match "spaces" in a string
var dashes:RegExp = /-/gi; // match "dashes" in a string
//Sample string with spaces and dashes
var str:String = "Bu s ~ Tim e - 2-50-00";
str = str.replace(spaces, ""); // find and replace "spaces"
str = str.replace(dashes, ":"); // find and replace "dashes"
trace(str); // output: Bus~Time:2:50:00