Read SWF height and width with Coldfusion
This is a handy little utility I ran across a while back. It allows you to easily read the width and height properties from an SWF using a Coldfusion component. Thanks to Doug Hughes for creating this.
Here's a sample of the Coldfusion code to use the FlashInspetor component.
<cftry>
<cfset localFile = ExpandPath( "../samples/rectangle.swf")>
<cfset flashInspector = CreateObject('component', 'components.FlashInspector').init(localFile)>
<!--- get the flash movie's width and height --->
<cfset width = flashInspector.getMaxX() />
<cfset height = flashInspector.getMaxY() />
<cfoutput>#localFile# <br/><b>width:</b> #width#, <b>height:</b> #height#</cfoutput>
<cfcatch>
<cfdump var="#cfCatch#"/>
</cfcatch>
</cftry>
Click here to see the FlashInspector reading some swfs.Download the FlashInspector.CFC.
Dec 15, 2006 at 11:49 PM
Can this use with AS3 swf files?
Dec 19, 2006 at 9:13 AM
Yes it does work with AS3 swf files. I have tested with numerous swfs generated from Flex Builder and they all worked fine.
Oct 03, 2007 at 5:44 PM
thanks for the code
Jul 14, 2008 at 9:50 PM
can you please give me a code how to get swf metadata in AS3?