Get the version of a loaded SWF into a MovieClip
-
20-02-2021 - |
Question
Is it possible to read the SWF version
of a loaded SWF into a main one?
var mcl:Loader = new Loader();
mcl.contentLoaderInfo.addEventListener (Event.COMPLETE, prepareDisplay(mcl));
mcl.load (new URLRequest ('movie.swf'));
function prepareDisplay (mcl:Loader):Function {
return function (e:Event):void {
mcl.contentLoaderInfo.removeEventListener (Event.COMPLETE, prepareDisplay);
media_container.addChild(mcl);
// how can I get the loaded swf version from here?
}
}
Solution
You should be able to check the swfVersion property of the Loaders contentLoaderInfo LoaderInfo object.
trace(mcl.contentLoaderInfo.swfVersion);
Constants can be used from: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/SWFVersion.html
OTHER TIPS
You can use this utility class to get the version information from the player you are using or the flash version of the compiled swf.
https://github.com/jamestomasino/tomasino/blob/master/org/tomasino/utils/Version.as
Just use:
var compiledSwfVersion:int = Version.COMPILE_FLASH_VERSION;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow