12.2.2 Embedding resources

Embedding resources is different in Haxe compared to ActionScript 3. Instead of using [embed] (AS3-metadata) use Flash specific compiler metadata like @:bitmap, @:font, @:sound or @:file.

import flash.Lib;
import flash.display.BitmapData;
import flash.display.Bitmap;

class Main {
  public static function main() {
    var img = new Bitmap( new MyBitmapData(0, 0) );

class MyBitmapData extends BitmapData { }

Take the Haxe Survey!