1
votes

I implemented this code (Can ActionScript tell when a SWF was published?) in my main swf file in my project. It works great. However I load many modules in my application. These modules get compiled as needed to make changes. I would like to be able to get the compile date for the module that is currently loaded.

Basically I have one main Flex "Application" It then loads and unloads various modules (individual swf files) as needed based on user choices. I need to be able to put a control on each of these modules that will get the date that specific swf file was compiled.

Is there a way to pass the current swf file to the function to get the compile date of that swf?

Paul

1

1 Answers

0
votes

Yes, use the Loader.contentLoaderInfo.bytes property, the Loader object being the one you used to load the SWF file.

You could change your function to accept the bytes of the SWF file as a parameter:

getCompilationDate(bytes:Array):void{
    ...
}

getCompilationDate(stage.loaderInfo.bytes)
getCompilationDate(moduleLoader.contentLoaderInfo.bytes)