AS3 SWFReader (by Senocular)


/ Published in: ActionScript 3
Save to your folder(s)

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


Copy this code and paste it in your HTML
  1. import com.senocular.utils.SWFReader;
  2. var swf:SWFReader = new SWFReader(root.loaderInfo.bytes);
  3.  
  4. trace("swf.compressed: "+swf.compressed);
  5. trace("swf.version: "+swf.version);
  6. trace("swf.fileSize: "+swf.fileSize);
  7. trace("swf.dimensions: "+swf.dimensions);
  8. trace("swf.width: "+swf.width);
  9. trace("swf.height: "+swf.height);
  10. trace("swf.tagCallbackBytesIncludesHeader: "+swf.tagCallbackBytesIncludesHeader);
  11. trace("swf.frameRate: "+swf.frameRate);
  12. trace("swf.totalFrames: "+swf.totalFrames);
  13. trace("swf.asVersion: "+swf.asVersion);
  14. trace("swf.usesNetwork: "+swf.usesNetwork);
  15. trace("swf.backgroundColor: "+swf.backgroundColor);
  16. trace("swf.protectedFromImport: "+swf.protectedFromImport);
  17. trace("swf.debuggerEnabled: "+swf.debuggerEnabled);
  18. trace("swf.metadata: "+swf.metadata);
  19. trace("swf.recursionLimit: "+swf.recursionLimit);
  20. trace("swf.scriptTimeoutLimit: "+swf.scriptTimeoutLimit);
  21. trace("swf.hardwareAcceleration: "+swf.hardwareAcceleration);
  22. trace("swf.tagCallback: "+swf.tagCallback);
  23. trace("swf.parsed: "+swf.parsed);
  24. trace("swf.errorText: "+swf.errorText);
  25. //trace("swf.toString: "+swf.toString);
  26. //trace("swf.parse: "+swf.parse);
  27.  
  28. // OUTPUT ...
  29. //swf.compressed: false
  30. //swf.version: 10
  31. //swf.fileSize: 7281
  32. //swf.dimensions: (x=0, y=0, w=550, h=400)
  33. //swf.width: 550
  34. //swf.height: 400
  35. //swf.tagCallbackBytesIncludesHeader: false
  36. //swf.frameRate: 30
  37. //swf.totalFrames: 1
  38. //swf.asVersion: 3
  39. //swf.usesNetwork: false
  40. //swf.backgroundColor: 16777215
  41. //swf.protectedFromImport: false
  42. //swf.debuggerEnabled: true
  43. //swf.metadata: <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  44. // <rdf:Description rdf:about="" xmlns:xmp="http://ns.adobe.com/xap/1.0/">
  45. // <xmp:CreatorTool>Adobe Flash CS4 Professional</xmp:CreatorTool>
  46. // <xmp:CreateDate>2010-04-13T11:55:21+01:00</xmp:CreateDate>
  47. // <xmp:MetadataDate>2010-04-14T15:36:11+01:00</xmp:MetadataDate>
  48. // <xmp:ModifyDate>2010-04-14T15:36:11+01:00</xmp:ModifyDate>
  49. // </rdf:Description>
  50. // <rdf:Description rdf:about="" xmlns:dc="http://purl.org/dc/elements/1.1/">
  51. // <dc:format>application/x-shockwave-flash</dc:format>
  52. // </rdf:Description>
  53. // <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#">
  54. // <xmpMM:DerivedFrom rdf:parseType="Resource">
  55. // <stRef:instanceID>xmp.iid:A46D647BE046DF11A42FA6A489EBD966</stRef:instanceID>
  56. // <stRef:documentID>xmp.did:A46D647BE046DF11A42FA6A489EBD966</stRef:documentID>
  57. // <stRef:originalDocumentID>xmp.did:A46D647BE046DF11A42FA6A489EBD966</stRef:originalDocumentID>
  58. // </xmpMM:DerivedFrom>
  59. // <xmpMM:DocumentID>xmp.did:17201428D147DF119956F0DDDFBC1A28</xmpMM:DocumentID>
  60. // <xmpMM:InstanceID>xmp.iid:17201428D147DF119956F0DDDFBC1A28</xmpMM:InstanceID>
  61. // <xmpMM:OriginalDocumentID>xmp.did:A46D647BE046DF11A42FA6A489EBD966</xmpMM:OriginalDocumentID>
  62. // </rdf:Description>
  63. //</rdf:RDF>
  64. //swf.recursionLimit: 15
  65. //swf.scriptTimeoutLimit: 256
  66. //swf.hardwareAcceleration: 0
  67. //swf.tagCallback: null
  68. //swf.parsed: true
  69. //swf.errorText:

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.