I’d like to write a little class that adds a Day/Month box showing the date a SWF was published from Flash.
The company I work for regularly produces many, many SWFs and many versions of each, iterating over the course of months. A version-tracking system we’ve been using to communicate with our clients is a Day/Month date-box that gives the date the SWF was published. Up until now, we’ve been filling in the publish date by hand. If there’s any way I can do this programatically with ActionScript that’d be fantastic.
Any insight? Basically, all I need is the call that gives me the publish date, or even.. anything about the circumstances under which a SWF was published that I could use to roll into some form of.. automated version identification, unique to this SWF.
So, can ActionScript tell when a SWF was published?
George is correct. Adobe sneaks an undocumented ProductInfo tag that contains the compilation date in to every compiled swf. The DisplayObject.loaderInfo.bytes contains the the complete uncompressed swf that loaded the Display Object.
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObject.html#loaderInfo
So the quickest way to get the swf’s compilation date without external libraries (from a Display Object):
The SWF Specification: http://www.adobe.com/content/dam/Adobe/en/devnet/swf/pdf/swf_file_format_spec_v10.pdf