External Configuration File in ActionScript 3

I need to be able to load external configuration files into my flex application. I read that this is possible using tabs while mimeType is set to application / octet-stream.

package learning {
    import org.flixel.*;
    public class PlayState extends FlxState {
        [Embed(source = "../../data/tiles.png")] private var _tiles:Class;
        [Embed(source = '../../data/map.txt', mimeType = "application/octet-stream")] private var ExternalMapData:Class;

        public var txt:FlxText;
        public var player:FlxSprite;

        override public function create():void {
            bgColor = 0xffaaaaaa;
            super.create();
        }

        override public function update():void {
            super.update();
        }
    }
}

When I compile this with mxmlc, it compiles successfully without errors. When I run SWF, it loads all the Flixel menus and then freezes.

If I comment out a line [Embed(source = '../../data/map.txt', it compiles and does not hang.

Why does this embed cause freezing?

Version Information for mxmlc:

Adobe Flex Compiler (mxmlc)
Version 4.0.0 build 14159

EDIT

It turns out that the errors do not display properly, but this is what I get from the embed attempt:

VerifyError: Error #1014: Class mx.core::ByteArrayAsset could not be found.

A bunch of people appear on Google with the same problem, but without a visible solution.

import mx.core.ByteArrayAsset; ByteArrayAsset

doesn't help either.

+3
2

! , - swf, . :

flex-config,

<static-link-runtime-shared-libraries>true</static-link-runtime-shared-libraries>

mxmlc

mxmlc -static-link-runtime-shared-libraries=true -debug=true Main.swf -- Main.as

+8

:

[Embed(source = "ExampleText.txt", mimeType = "application/octet-stream")]
protected var AAAAAA:Class;

var tmp:ByteArray = new AAAAAA();
var result:String = tmp.readMultiByte(tmp.bytesAvailable, tmp.endian);
+3

All Articles