About Archive Tags RSS Feed

 

Recently I've been working with flash

19 October 2010 21:50

Recently I've been producing simple Flash animations.

Mostly these are simple "Show an image, slide it around a bit, show another..". But I still feel vaguely unclean and non-free.

I started off using the SWF Perl binding, but soon realised that wasn't much fun. So I wrote a mini intepretter such that I can script creation:

#!/usr/bin/flash-scripter

# create the movie
create 640 480

# background == black
clear 0, 0, 0

# load image at 0,0
load 0, 0, foo.png

# move it about a bit
move 0, -1
move 0, -1
move 0, -1

# movie-time is over now.
stop

# finally save the movie
save foo.swf

# all done
exit

I see I'm not alone in doing such a thing as swftools (not available for Debian) includes swfc "A tool for creating SWF files from simple script files.". Sadly swftools fails to build for me on Squeeze so I couldn't try it out.

My little tool is called SWF::Scripter and uses plugins to implement each "command" so I should probably upload it somewhere public. On the other hand it was a quick hack to produce a mini-story from a bunch of images with no complex transitions so I'm not sure it is worth the effort.

ObQuote: "I honestly think I'd give up smoking if he asked me." - Breakfast at Tiffany's

| 7 comments

 

Comments on this entry

icon Fabian at 10:22 on 19 October 2010

> Sadly swftools fails to build for me on Squeeze so I couldn't try it out.

It fails to build when the lame headers are not installed, even if configured with "--disable-lame". With the lame headers, it builds just fine. So I assume there is an autoconf syntax error when it comes to creating config.h.

- Fabian

icon Steve Kemp at 12:27 on 19 October 2010
http://www.steve.org.uk/

Thanks for that - it wasn't an intuitive failure and I struggled to diagnose it.

I'll have another go later this evening, and if it works I guess my own scripty-fun is obsolete.

icon Anonymous at 17:34 on 19 October 2010

Looking at your example makes me wonder if something like Cairo could have an SWF backend.

icon Steve Kemp at 20:27 on 19 October 2010
http://www.steve.org.uk/

I'm afraid I know nothing of Cairo..

Though for what it is worth I've added the Perl code to my generic repository: SWF-Scripter.

icon Ben Lau at 22:58 on 19 October 2010
http://netjunki.org

I really like a tool called swfmill. The company where I work depends heavily on Flash for our web based training tool, and I was trying to find ways to automate the extraction of content from our previous system and convert it into .swf format (basically large numbers of image sequences for animations). Since it uses an XML representation of the swf format I was able to do some fairly complex stuff without having to write something too crazy. I also experimented with using the Flex SDK command line tools to compile an MXML version of the same thing... but found the generated .swf sizes were much too large for use in our application.

icon foo at 04:44 on 20 October 2010

swftools was in Debian before but no-one cared about it:

http://packages.qa.debian.org/s/swftools.html
http://bugs.debian.org/566575

icon Aaron Ucko at 19:34 on 21 October 2010
http://www.mit.edu/~amu/

On a side note, you seem to have stumbled on an interesting new development: recent Linux kernel versions (as of 2.6.27-9, per http://www.in-ulm.de/~mascheck/various/shebang/) allow recursive #! use, up to a hard-coded limit of 4.