This is an example showing how to use the module Base64 to encode and decode text strings under CS4 flash 10.
4 things need to do:
1. set preference for loading external class files by clicking <edit><reference><actionscript><actionscript 3.0> select the chosen on class folder to start with.
2. open a fla file. In this program you will to prepare a “textfield” and 2 “Movieclips” as buttons.
var sample = new Textfield();
sample.width = 500;
sample.height = 200;
sample.text = “This tutorial will allow you to learn to create custom Flash Components using Actionscript 3.0. I have opted an image gallery component where we would show thumbnails of various images and user could see respective enlarged image by clicking any of the thumbnail. I have used FlickR image search to show various images using this component.”;
teststring:String = Base64.encode(sample.text);
sample.text = teststring
teststring = Base64.decode(sample.text);
sample.text = teststring;