Now, I actually have found a VBscript function that will take such a data structure (basically, a densely packed array of single bytes that each hold a printable-ascii-character code value) and return the unpacked, 2-byte character string representation (a readable string).
For I = 1 to LenB(Binary)
S = S & Chr(AscB(MidB(Binary,I,1)))
BinaryToString = S
Now, my goal is to create the same “binary object” from a Flash file, instead of having to use that other ActiveX control (basically I am trying to replace that other ActiveX control).
In AS3, I can create an identical type of byte structure using a ByteArray, in that the “in memory file” it works with is actually just a densely packed set of bytes, where each one represents a single ascii character (0-255 byte value). Of course, all the other info in the ByteArray data structure is unnecessary for my purposes (properties, methods, etc).
In fact, the object I get in the scripting container is in fact a valid, addressable array, with a length parameter added as expected (and with the correct value for the number of items!), but each item in the array has grown from the 4-byte representation I gave it when packing in single bytes to some larger number of bytes (the variant data type biting me in the butt!). In fact, different items in the array appear to be different sizes (in bytes), some 20 bytes, some 18 bytes, etc.
I = LenB(myBlah)
SizeOfBytes = I
The weird thing really is that the object’s values, plus it’s length property, do not constitute its entire byte size apparently. I sent down 20 packed uint values in my array, which collectively should have been 80 bytes in size (or 84 if you count the length property) and what I get is an array that is 430 bytes in size. I looped through all 20 items in the array (some 20, some 18, etc), and added up their sizes, and I get 392 bytes. And 4 bytes for the size of the length property. That only accounts for 396 bytes. So now I’m really confused as to where the other 34 bytes is going.
I still want to see if there’s any creative way of getting my “binary object” out of flash and into my script. Thoughts?