arrayToHexString

Converts an Array into a hex string that is used by ssCore.FileSys.appendToFileBinary and ssCore.FileSys.writeToFileBinary.


Availability:

First available in version 3.5 build 314.

Not available in ActionScript 3.


Usage:

dataStr = StringUtils.arrayToHexString(dataArr)

dataStr - String - The Array data represented as a hex string formatted as two characters per byte.


Parameters:

dataArr - Array - An Array that will be converted into a hex string.


Notes:

Editing binary values cannot be done directly in ActionScript. However, if the data can be represented as an array of bytes you can then manipulate data at the byte level. Use this function to convert an Array into data that can be written by ssCore.FileSys.appendToFileBinary and ssCore.FileSys.writeToFileBinary.

Due to speed limitations of ActionScript 1 and 2 it is not recommended to convert large amounts of data. At 1,200 KB, depending on system resources, the Flash Player will most likely warn the user about a script taking too long.

See ssCore.FileSys.appendToFileBinary, ssCore.FileSys.readFileBinary, ssCore.FileSys.writeToFileBinary, and StringUtils.hexStringToArray.


Examples:

var dataStr:String = StringUtils.arrayToHexString(myArray);

var r:Object = ssCore.FileSys.writeToFileBinary({path:"startdir://file.swf", data:dataStr});