well i havent really seen anyone work with strings and someone already used the idea i was gonna use fireworks =( but o’well what it does is encodes and string
and can decode i think the correct term is encrypt but i used encode well here we go
function buildInterface():Void {
_root.createEmptyMovieClip("holder", getNextHighestDepth(), {_x:252.9, _y:147.7}), _root.holder.createTextField("change", getNextHighestDepth(), 252.9, 147.7, 127, 22.1), holder.change.multiline=true, holder.change.html=true, holder.change.htmlText="<u>Change decode or encode</u>";
_root.createEmptyMovieClip("holder2", getNextHighestDepth(), {_x:0, _y:0}), _root.holder2.createTextField("change2", getNextHighestDepth(), 252.9, 167.7, 127, 22.1), holder2.change2.multiline=true, holder2.change2.html=true, holder2.change2.htmlText="<u>Clear textFields</u>";
_root.createTextField("output", getNextHighestDepth(), 62.0, 259.7, 317.9, 228.3), output.multiline=true, output.wordWrap=true;
_root.createTextField("mytext", getNextHighestDepth(), 50.9, 10, 350, 200.1), mytext.multiline=true, mytext.wordWrap=true, mytext.text="First off to encode the text type the text in input textbox and press the orange square"+newline+"to switch from encode mode to decode mode just press the text labeled ~change decode or encode~"+newline+"now if you happen to start off by decoding a string before encoding you will run into some problems but ya! pretty cool design of random wierd letters i do think so myself =) enjoy!!", mytext.selectable=false;
_root.createTextField("usertext", getNextHighestDepth(), 67.0, 193.7, 192.9, 20.1), usertext.type="input", usertext.border=true, usertext.antiAliasType="advanced", usertext.text="type text here", _root.createTextField("decoder", getNextHighestDepth(), 252.9, 125.7, 48, 20.1), decoder.text="encode", decoder.selectable=false, decoder.autoSize=true, decoder.textColor=0xFF9933;
_root.createEmptyMovieClip("enter", getNextHighestDepth(), {_x:273.3, _y:198.3}), _root.enter.moveTo(350, 350), _root.enter.beginFill(0xFF9933, 100), _root.enter.lineTo(350, 350), _root.enter.lineTo(350, 400), _root.enter.lineTo(400, 400), _root.enter.lineTo(400, 350);
_root.holder.onRelease = function():Void {
_root.decoder.text == "encode" ? _root.decoder.text="decode" : _root.decoder.text="encode";
};
_root.holder2.onRelease = function():Void {
_root.output.text = "";
};
_root.enter.onRelease = function():Void {
for (i=0; i<_root.usertext.text.length; i++) {
if (_root.decoder.text == "decode") {
str=_root.usertext.text.toString(), temp=Number(str.charCodeAt(i)), temp=temp/2, temp2=String.fromCharCode(temp), _root.output.text += temp2;
} else if (_root.decoder.text == "encode") {
str=_root.usertext.text.toString(), temp=Number(str.charCodeAt(i)), temp=temp*2, temp2=String.fromCharCode(temp), _root.output.text += temp2;
}
}
_root.output.text += newline, _root.usertext.text="";
};
}
buildInterface();