Question

I know that it is possible to add swf metadata to the compile command as a command option, but I can't find any documentation on how to access these metadata within the actionscript during runtime. We're trying to add a version number to the swf during compile time and then somewhere in our app we would retrieve it during runtime, here is the command example to add the description metadata.

mxmlc -description "version 1.2.3"

I know the swf metadata is used by search engines and other utilities to gather information about the SWF file, but surely you should be able to retrieve them in the actionscript during runtime?

Was it helpful?

Solution

Have you tried to namespace it like this: http://hasseg.org/blog/?p=165

So maybe "-define+=VERSION::description,"version 1.2.3"

And then access it using the example code:

var VERSION:Namespace = new Namespace("VERSION");
var ver:String = VERSION::description;

EDIT: Hmm. Doesn't work for me in Flex Builder, but I found this: http://livedocs.adobe.com/flex/3/html/help.html?content=compilers_21.html, which seems to confirm the idea.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top