you could load some json data at runtime and most of the time this is the best thing to do as it’s likely you’ll want to be able to change that data without recompiling. but what about some json data for a sprite sheet? it’s easy enough to embed images in actionscript but what about text files? it’s a little bit different..
package
{
public class EmbedJsonTest extends Sprite
{
[Embed(source="data.json",mimeType="application/octet-stream")]
private const JsonData : Class;
public function EmbedJsonTest()
{
var ba : ByteArray = new JsonData() as ByteArray;
trace("JsonData = " + ba.readUTFBytes(ba.length));
}
}
}