Reading ActionScript 3 constants from SWF in PHP

Just wondering if there is a way to read the static class constants from the SWF file server side. I found things like getimagesize() , but it does not have all these details. I guess this means that I need a partial decompiler.

In particular, I have this class in my Flex project:

 package { public class AppVersion { public static const SVN_VERSION:String = "172"; public function AppVersion() { } } } 

SVN_VERSION updated using ant script on build. AppVersion.SVN_VERSION displayed to the user using ActionScript code, so it should be available somewhere in SWF.

I would like to be able to read this version with PHP so that it knows which version of SWF it is dealing with. The same SWF is used in about 20 projects of various modifications, so PHP will be a little different depending on what happens. PHP runs on Mac OSX or Linux, if that matters.

+4
source share
1 answer

You can send a value to PHP using the following classes:

Basically it will just be something like:

 var variables:URLVariables = new URLVariables(); variables.svnVersion = SVN_VERSION; var request:URLRequest = new URLRequest("http://your_domain.com/your_php_file.php"); request.method = URLRequestMethod.POST; request.data = variables; var loader:URLLoader = new URLLoader(); loader.load(request); 

And from here you can access the value in PHP via:

 $_POST["svnVersion"]; 
+1
source

All Articles