Is it possible to get swf metadata in an ActionScript flex project?

I know that you can add swf metadata to a compilation command as a parameter to the command, but I cannot find documentation on how to access this metadata in ActionScript at runtime. We are trying to add the version number to swf at compile time, and then somewhere in our application we will retrieve it at run time, here is an example command to add description metadata.

mxmlc -description "version 1.2.3"

I know that swf metadata is used by search engines and other utilities to collect information about a SWF file, but you can probably get it in ActionScript at runtime?

+3
source share
1 answer

Have you tried to skip this as follows: http://hasseg.org/blog/?p=165

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

And then access it using an 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 this idea.

+2
source

Source: https://habr.com/ru/post/1717691/


All Articles