Getting Flash metadata info CF

ColdFusion , Flex / AIR , Flash Add comments

We are currently working on a large project requiring hundreds of Flash assets. On of the requirements is to be able to detect the end of an animation; in Flash 8, you use _currentFrame == _totalFrames.  This naturally has changed in AS3 to currentFrame == totalFrames.  When using the AS3 notation (inside a Flex app) to examine the Flash 8/AS 2 file, both values come back null.

We discovered that some of them were published for Flash 8, and others for Flash 9. Problem....

ColdFusion to the rescue.

Rupesh Kumar, one of the Adobe engineers, happened to post about a month ago a snippet of Java code that extracted metadata from a SWF.  Combining this w/CF yielded the following script, which I was able to pull directly into Excel.

<cfset dir = "D:/workspace/eclipse3.3/farcry_demo/www/courses/assets/VangentAssets/" />
<cfset filter = "*.swf" />

<cfdirectory name="qDir" action="list" directory="#dir#" filter="#filter#" recurse="true" />

<table>
    <tr>
        <th>File</th>
        <th>Is Compressed</th>
        <th>Frame Count</th>
        <th>Frame rate</th>
        <th>Version</th>
        <th>Height</th>
        <th>Width</th>
    </tr>
<cfoutput query="qDir">

    <cfset filePath = qDir.directory & "\" & qDir.Name />
    <cfset filePath = replace(filePath, "\", "/", "all") />

    <cfscript>
      fis = createObject("java", "java.io.FileInputStream").init( "#qDir.directory#\#qDir.Name#" ) ; // Create the FileInputStream
      decoder = createObject("java", "macromedia.swf.TagDecoder").init(fis); // create TagDecoder
      header = decoder.decodeHeader(); // Decode the header.
      fis.close();
      rect = header.size;
    </cfscript>

     <tr>
        <td>#qDir.directory#\#qDir.Name#</td>
        <td>#header.compressed#</td>
        <td>#header.framecount#</td>
        <td>#header.rate#</td>
        <td>#header.version#</td>
        <td>#rect.getHeight()#</td>
        <td>#rect.getWidth()#</td>
    </tr>

</cfoutput>
</table>

<cfsetting showdebugoutput="false" />

7 responses to “Getting Flash metadata info CF”

  1. peterFM Says:
    I still think PHP has a major role to play in the future, with PHP5 object oriented and great features like SimpleXML - http://file.sh/XML+torrent.html. IMHO I see PHP scripts for frontend apps and RoR apps for all the backend stuff, and that’s what I’am actually trying to do at work.
  2. adam@yahoo.com Says:
    I’m pleased I found this weblog, I couldnt discover any info on this subject matter earlier to. I also operate a site and if you want to ever severe in a little bit of guest writing for me if possible really feel free to let me know, i am usually look for people to check out my site.
  3. adam@yahoo.com Says:
    I’m pleased I found this weblog, I couldnt discover any info on this subject matter earlier to. I also operate a site and if you want to ever severe in a little bit of guest writing for me if possible really feel free to let me know, i am usually look for people to check out my site.
  4. accessories Says:
    I’m pleased I found this weblog, I couldnt discover any info on this subject matter earlier to. I also operate a site and if you want to ever severe in a little bit of guest writing for me if possible really feel free to let me know, i am usually look for people to check out my site.Hey, appreciate it for taking the effort to do this. I like your webpage, although it took a sluggish reader like me some time to via throughout entire page and the many comments.
  5. Singleton20Lilly Says:
    According to my exploration, billions of persons on our planet get the <a href="http://bestfinance-blog.com">loans</a>; at different creditors. So, there's good possibilities to get a short term loan in all countries.
  6. jackFex Says:
    The year also brought many great research articles, blogs, and publications addressing these and other important issues.
    Press Releases Newsletters Webinars Multimedia Advertise Go!
    All Packages are discreetly labeled, Same Day shipping and Overnight Delivery are available!

    <a href=http://kamagra100mgoraljelly.today>purchase</a>;
  7. nrjqfrTed Says:
    topvk47n7h</br>
    payday loan direct lender</br>
    <a href="http://cashadvances2017.com">; legitimate payday loans online no credit check</a> </br>
    &lt;a href=&quot;http://paydayloans2017.com&quot;&gt; what is a payday loan&lt;/a&gt; </br>
    http://paydayloans2017.com - payday loan online </br>
    fast payday loans

Leave a Reply





Powered by Mango Blog. Design and Icons by N.Design Studio