On 2/24/2014 1:25 AM, Maurice Amsellem wrote:
You can embed non-code assets in your swf, and access them from your code.
This is usually images, but it can also be text files.

http://stackoverflow.com/questions/2141276/flex3-load-contents-of-an-embedded-text-file-into-a-variable

Okay, that looks pretty good. Can I put that Embed in a .as file, or does it have to be in an MXML file?

I'm also rethinking my response to Alex Harui's question:
>> Also, you may want to load the script externally so you can change it without having to recompile the app.

When I start debugging my script, things _will_ go a little faster if I can just change the script and not have to go through the compile phase. I'm only partway through building my project (the parser function has no code, and the classes for Room, Thing, and Character aren't even defined yet), and it's already taking about a minute to compile.

So... if I wanted to read in the script from an external file, how would I do that? It occurred to me overnight that I could just zip up the .swf file and any text files I need, and tell the user to unzip it into any folder he likes. _Almost_ as simple as a single .swf file.

It does have the problem that the player can read the text file and get all the solutions. but heck! if I embed the text in my .swf anybody can use swfdumpto get the text. Or the unix strings utility.

I suppose I could put some trivial encryption on it, say xor it with a constant... At least then it wouldn't just stand out when somebody dumps the file.

Reply via email to