While working on a Flash AS3 application, I needed to manipulate a string and found out that old AS1 and AS2 str.replace() would not work in the same way in the AS3. Instead I ended up using split and join functions for a simple string replacement.
var str:String = "No Donuts for you!"; //replace a word with another str = str.split("Donuts").join("Walnuts"); trace(str);
Hope that helps.