Skip to content

Instantly share code, notes, and snippets.

@benbjohnson
Created December 10, 2010 21:38
Show Gist options
  • Save benbjohnson/736869 to your computer and use it in GitHub Desktop.
Save benbjohnson/736869 to your computer and use it in GitHub Desktop.
Pure AS3 Text File Embed
package
{
import flash.utils.ByteArray;
[Embed(source="strings.txt", exportSymbol="EmbeddedText", mimeType="application/octet-stream")]
public class EmbeddedText extends ByteArray
{
}
}
package
{
import flash.display.Sprite;
import flash.text.TextField;
[SWF(width="800", height="600")]
public class EmbedExample extends Sprite
{
public function EmbedExample()
{
var textfield:TextField = new TextField();
textfield.text = (new EmbeddedText()).toString();
addChild(textfield);
}
}
}
foo=bar
baz=bat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment