I embed a text file into my Flex project and read its contents using code like this:
[Embed(source = "../../data/abc.txt", mimeType = "application/octet-stream")]
private var r_Abc:Class;
...
var xx:ByteArray = new r_Abc();
var abc:String = xx.toString();
The contents of the file is abc. The problem is that the string loaded from the file is not comparable to other strings even though when printed or viewed in the debugger (in FlashDevelop) it seems to be perfectly fine.
trace(abc); // abc
trace("abc" == abc); // false
How do I convert it into a proper string? I tried to use the string methods such as substring to create a copy, but that does not seem to be the solution.
abc-variable is undefined.