<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Karoshi Ethos &#187; PNG sequence SWF swftools batch</title>
	<atom:link href="http://karoshiethos.com/tag/png-sequence-swf-swftools-batch/feed/" rel="self" type="application/rss+xml" />
	<link>http://karoshiethos.com</link>
	<description>Navigating the treacherous waters of interactive technology</description>
	<lastBuildDate>Mon, 09 Aug 2010 15:23:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>PNG sequence to SWF</title>
		<link>http://karoshiethos.com/2008/09/03/png-sequence-to-swf/</link>
		<comments>http://karoshiethos.com/2008/09/03/png-sequence-to-swf/#comments</comments>
		<pubDate>Wed, 03 Sep 2008 19:59:18 +0000</pubDate>
		<dc:creator>jon</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[PNG sequence SWF swftools batch]]></category>

		<guid isPermaLink="false">http://karoshiethos.com/?p=109</guid>
		<description><![CDATA[I needed to stitch a stack of PNG images into a SWF using a server process. There are quite a few tools and methods for doing this interactively, but it gets painful if you want an unattended process.
I found SWFTools (includes PNG2SWF.EXE), which handles the awful, complex bit of ... building a SWF from a [...]]]></description>
			<content:encoded><![CDATA[<p>I needed to stitch a stack of PNG images into a SWF using a server process. There are quite a few tools and methods for doing this interactively, but it gets painful if you want an unattended process.</p>
<p>I found <a href="http://swftools.org/">SWFTools</a> (includes PNG2SWF.EXE), which handles the awful, complex bit of ... building a SWF from a bunch of PNGs, but then I needed to figure out how to get it to auto-magically use all the PNGs in a specific folder. Essentially, I found a tool that does the hard part, but I needed to cobble together the actual command it should use. Wince if you want to, but I'm a masochist and I hacked together this batch file (like it's 1988, baby):</p>
<p><code>@echo OFF<br />
SET LIST=<br/><br />
REM Build a list of PNGs<br />
for /f "delims=" %%a in ('dir /b /a-d %1*.png 2^&gt;NUL') do call :process %%a %1<br/><br />
@echo ON<br />
REM now make a SWF!<br />
CALL png2swf -r 20 -o %2 %LIST%<br/><br />
SET LIST=<br />
goto :eof<br/><br />
:process<br />
REM append the next file to the LIST variable<br />
if not "%LIST%"=="" set LIST=%LIST%<br />
set LIST=%LIST%%~2%~1</code></p>
<p>example usage -- test.bat c:\path\pngFolder c:\path\resulting.swf</p>
<p>I'm sure this is dead easy in linux (you can get swftools in linux flavors too, including source), and I'll send cookies to whoever posts the first working script in the comments.</p>
<p>Note: I'm not sure why this is, but the resulting SWF can't be imported into Flash CS3 as one would expect. If you were going to do <em>that</em>, you could've imported the initial sequence in the first place.</p>
]]></content:encoded>
			<wfw:commentRss>http://karoshiethos.com/2008/09/03/png-sequence-to-swf/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
