Recently I've been working with flash

Tuesday, 19 October 2010

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

[gravitar] Fabian

Submitted at 10:22:36 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

[author] Steve Kemp

Submitted at 12:27:24 on 19 october 2010

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.

[gravitar] Anonymous

Submitted at 17:34:30 on 19 october 2010

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

[author] Steve Kemp

Submitted at 20:27:48 on 19 october 2010

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.

[gravitar] Ben Lau

Submitted at 22:58:06 on 19 october 2010

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.

[gravitar] foo

Submitted at 04:44:53 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

[gravitar] Aaron Ucko

Submitted at 19:34:14 on 21 october 2010

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.

 

Comments are closed on posts which are more than ten days old.

Recent Posts

Recent Tags