views:

181

answers:

2

There is some way to make the flash put the content of one text file in a string, or at least put it in the .swf, so the user don't need to download it?

A: 

I've always used a pre-compile step to populate a template. It's pretty easy to make a class that has a string to be populated before compilation.

Ant can do this pretty easily. Check out the replace task.

Its documentation is here: http://ant.apache.org/manual/CoreTasks/replace.html

ablerman
What does apache can teach me about actionscript 3? o_OI mean, flash is compiled, I don't think the text can be replaced by the apache.
M28
The apache project umbrella contains a whole host of subprojects. One of which is a build system called ant.
ablerman
+2  A: 

Solution:

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

var tmp:ByteArray = new pscene();
result = tmp.readMultiByte(tmp.bytesAvailable, tmp.endian);

It took me a while to understand how to read the data from the Byte Array.

M28