COMMUNITY

Flash Target: Passing args to @:file

haxe-swf

#1

How do I give @:file metadata access to variables from other classes? I’m trying to load XML scripts for the flash target of my game, and this is the only way I’ve found so far that lets me load them in, so other flash-supported alternatives are appreciated.

Code:

The following works:
@:file(“assets/script/__testcase.xml”)
class MyXMLData extends ByteArray { }

The following does not work:
@:file(FilePasser.file)
class MyXMLData extends ByteArray { }

I’ve thought about making a class constructor to solve this problem, but I’m not sure how to construct metadata.


#2

I managed to find a solution that I’m currently figuring out. Thanks.