In ActionScript, you can do something like this:
[Embed(source = "src/myfile.xml", mimeType = "application/octet-stream")] private var xml : Class;
and it will embed your file, which will be used in the code. How can I do something like this in Haxe?
Haxe allows you to provide information about external resources for embedding in hxml.
You can refer to the document .
Everything has changed since the question was asked. With the modern version of haxe you can do:
@:bitmap("test.png") class TestBMD extends BitmapData {} var bm = new Bitmap(new TestBMD(100,100));
/ , @:bitmap, :
@:bitmap
import openfl.Assets; ... var bm = new Bitmap(Assets.getBitmapData("test.png"));
XML is easy to use for haxe. Add -resource myfile.xml@myxml. Then in your code to get the xml string use haxe.Resource.getString("myxml"). Then you can parse this string in xml.
-resource myfile.xml@myxml
haxe.Resource.getString("myxml")
Source: https://habr.com/ru/post/1763710/More articles:Magento Create a product attribute that is integer - phpGrails Send Mail not working - sslhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1763707/create-custom-right-click-context-menu-item-with-c-for-all-desktop-shortcuts-windows-explorer&usg=ALkJrhiqi3OIkzF0Zn78iarCSsneWygeJAWhich cmdlets use the IHostUISupportsMultipleChoiceSelection interface to request a selection? - interfaceMacOSX открыть файл с приложением: куда он идет? - macosCheck: inclusion in rails based on the parent value of the model attribute - validationResource presentation pregeneration - restTwo main questions - c ++Differences browser jQuery.val () - jqueryJQuery - Detect CSS display support: table-row-group '- javascriptAll Articles