Imports arbitrary data as DefineBinaryData swf tag.
| import | Path to the file to be imported. |
| class | Class name assigned to imported data. |
| genclass | (false, symbolOnly, symbolAndClass) Controls the generation of symbols and AS3 class stubs. Available values are: false (don’t generate neither symbol nor AS3 class stub), symbolOnly (generate only symbol), symbolAndClass (generate symbol and AS3 class stub) |
| compress | (false, true) Controls the compression of imported data. |
| flash.utils.ByteArray | The superclass of AS3 class stub. |
Assuming that Binary import module is assigned to namespace bin the following snippet imports and then compresses /data/list.txt, exports it with symbolclass name resources.NameList and generates a corresponding AS3 class stub (default behavior):
<bin:binary import="/data/list.txt" class="resources.NameList" compress="true"/>
Manual creation of class stub. First import the file with genclass set to symbolOnly
<bin:binary import="/data/list.txt" class="resources.NameList" genclass="symbolOnly" compress="true"/>
then define the class stub in haXe:
package resources;
class NameList extends flash.utils.ByteArray {
public function new() {
super();
}
}