function encryptAscii(str:String, opt:Boolean):String { var strArr:Array = str.split(""); for (var i in strArr) { strArr[i] = String.fromCharCode( strArr[i].charCodeAt(0)+(opt ? 64 : -64) ); } return strArr.join(""); } //ueage //var ch:String = "written by samstudio.2005.12.04"; //trace(ch); //ch = encryptAscii(ch, true); //trace(ch); //ch = encryptAscii(ch, false); //trace(ch); en_btn.onRelease=function () { out_txt.text=encryptAscii(in_txt.text, true) } de_btn.onRelease=function () { out_txt.text=encryptAscii(in_txt.text, false) }