Question

How to monitor version in swf file when we compile a swf file in Adobe Flex file?

Was it helpful?

Solution

Assuming I understand your question correctly, you should check out this blog post of mine, titled "Saving and Accessing Version/Compilation Information with Flex Applications", which goes on to explain how you can use the conditional compilation feature in the mxmlc compiler to save variable values into the compiled binary and then print them to the log (or display in the user interface) within the app itself.

Here are the relevant snippets from that post:

# Compiling the binary with the conditional compilation parameter:
/path/to/mxmlc -define+=DEBUG::compiled,"Fri_Sep_12_17:26:13_on_Alis-MacBook.local" -strict=true /path/to/myApp.mxml

// Printing out the "compiled" value in the application code:
var DEBUG:Namespace = new Namespace("DEBUG");
var compiledStr:String = DEBUG::compiled;
trace("SWF was compiled: "+compiledStr);

As far as the actual "version number" goes, I just use three things:

  • the compilation date (see the example scripts in the post for info on how to automate this)
  • the hostname of the computer where it was compiled (also demonstrated in the post)
  • the SVN revision of the working copy (see my answer to this question for info on how to get the SVN revision number)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top