Return to Snippet

Revision: 25938
at April 14, 2010 09:38 by adrianparr


Initial Code
import com.senocular.utils.SWFReader;
var swf:SWFReader = new SWFReader(root.loaderInfo.bytes);

trace("swf.compressed: "+swf.compressed);
trace("swf.version: "+swf.version);
trace("swf.fileSize: "+swf.fileSize);
trace("swf.dimensions: "+swf.dimensions);
trace("swf.width: "+swf.width);
trace("swf.height: "+swf.height);
trace("swf.tagCallbackBytesIncludesHeader: "+swf.tagCallbackBytesIncludesHeader);
trace("swf.frameRate: "+swf.frameRate);
trace("swf.totalFrames: "+swf.totalFrames);
trace("swf.asVersion: "+swf.asVersion);
trace("swf.usesNetwork: "+swf.usesNetwork);
trace("swf.backgroundColor: "+swf.backgroundColor);
trace("swf.protectedFromImport: "+swf.protectedFromImport);
trace("swf.debuggerEnabled: "+swf.debuggerEnabled);
trace("swf.metadata: "+swf.metadata);
trace("swf.recursionLimit: "+swf.recursionLimit);
trace("swf.scriptTimeoutLimit: "+swf.scriptTimeoutLimit);
trace("swf.hardwareAcceleration: "+swf.hardwareAcceleration);
trace("swf.tagCallback: "+swf.tagCallback);
trace("swf.parsed: "+swf.parsed);
trace("swf.errorText: "+swf.errorText);
//trace("swf.toString: "+swf.toString);
//trace("swf.parse: "+swf.parse);

// OUTPUT ...
//swf.compressed: false
//swf.version: 10
//swf.fileSize: 7281
//swf.dimensions: (x=0, y=0, w=550, h=400)
//swf.width: 550
//swf.height: 400
//swf.tagCallbackBytesIncludesHeader: false
//swf.frameRate: 30
//swf.totalFrames: 1
//swf.asVersion: 3
//swf.usesNetwork: false
//swf.backgroundColor: 16777215
//swf.protectedFromImport: false
//swf.debuggerEnabled: true
//swf.metadata: <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
//  <rdf:Description rdf:about="" xmlns:xmp="http://ns.adobe.com/xap/1.0/">
//    <xmp:CreatorTool>Adobe Flash CS4 Professional</xmp:CreatorTool>
//    <xmp:CreateDate>2010-04-13T11:55:21+01:00</xmp:CreateDate>
//    <xmp:MetadataDate>2010-04-14T15:36:11+01:00</xmp:MetadataDate>
//    <xmp:ModifyDate>2010-04-14T15:36:11+01:00</xmp:ModifyDate>
//  </rdf:Description>
//  <rdf:Description rdf:about="" xmlns:dc="http://purl.org/dc/elements/1.1/">
//    <dc:format>application/x-shockwave-flash</dc:format>
//  </rdf:Description>
//  <rdf:Description rdf:about="" xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/" xmlns:stRef="http://ns.adobe.com/xap/1.0/sType/ResourceRef#">
//    <xmpMM:DerivedFrom rdf:parseType="Resource">
//      <stRef:instanceID>xmp.iid:A46D647BE046DF11A42FA6A489EBD966</stRef:instanceID>
//      <stRef:documentID>xmp.did:A46D647BE046DF11A42FA6A489EBD966</stRef:documentID>
//      <stRef:originalDocumentID>xmp.did:A46D647BE046DF11A42FA6A489EBD966</stRef:originalDocumentID>
//    </xmpMM:DerivedFrom>
//    <xmpMM:DocumentID>xmp.did:17201428D147DF119956F0DDDFBC1A28</xmpMM:DocumentID>
//    <xmpMM:InstanceID>xmp.iid:17201428D147DF119956F0DDDFBC1A28</xmpMM:InstanceID>
//    <xmpMM:OriginalDocumentID>xmp.did:A46D647BE046DF11A42FA6A489EBD966</xmpMM:OriginalDocumentID>
//  </rdf:Description>
//</rdf:RDF>
//swf.recursionLimit: 15
//swf.scriptTimeoutLimit: 256
//swf.hardwareAcceleration: 0
//swf.tagCallback: null
//swf.parsed: true
//swf.errorText:

Initial URL
http://www.senocular.com/flash/actionscript/?file=ActionScript_3.0/com/senocular/utils/SWFReader.as

Initial Description
You need to create the 'SWFReader.as' class file (see link above) and save it in to the package (folder structure) 'com/senocular/utils'.

Initial Title
AS3 SWFReader (by Senocular)

Initial Tags
data

Initial Language
ActionScript 3