ActionScript provides built-in support for base64 encoding/decoding through the Base64Encoder and Base64Decoder classes in the mx.utils package.
To run this ActionScript program, you would typically compile it into a SWF file and run it in a Flash Player or AIR runtime environment. The output would be similar to:
Note that ActionScript’s built-in Base64 encoding is similar to the standard encoding in other languages. For URL-safe encoding, we’ve implemented a simple conversion that replaces + with -, / with _, and removes padding = characters. This is a common approach for making Base64 strings safe for use in URLs.
Unlike some other languages, ActionScript doesn’t provide a built-in URL-safe Base64 encoding, so you might need to implement it yourself or use a third-party library in real-world applications.