Based on Daves swftophp. Tested only on a Linuxbox (SuSE 7.2). Would like to hear from success with other OS/versions. Peter Liscovius
I started from swftophp-source, converted this to a swftoperl and made some changes/enhancements, because swftophp and the util-stuff wasn't updated for a while.
The aim is to provide a program that can take a flash 3/4/5/? file and convert it to a ming-perl script that produces the same or a better/smaller flashfile with the same behavior without the need to change anything.
Start a console, go to the $ming/util/ - directory and type make swftoperl
Now swftoperl should be build from c-source in the same directory. (i hope successful.)
Type swftoperl
to test. It should tell you something like Give me a filename.
swftoperl myflash.swf
To save the script to a file, go to a console and type
swftoperl myflash.swf >myflash.pl
or
swftoperl /home/peter/myflash.swf >/home/peter/myflash.pl
or
swftoperl ~/myflash.swf >~/myflash.pl
myflash.swf is the name of your flashfile.
Some additional informations will be maybe printed to STDERR, so you don't have the ugly text in your myflash.pl , but you know about it.
Works this in the same way under Windows?
void printTextField(FILE *f, int length){}
in swftoperl.c
SWF::Shape->setMaskLevel(depth)
included. Enables masks using shapes. (depth-1) is the number of the following objects(shapes,movieclips,..) that will maybe added at the same movie or movieclip.
$maskshape_i = $movie->add($maskshape);
$maskshape_i->setMaskLevel(2);
$shapeA_i = $movie->add($shapeA);
$shapeB_i = $movie->add($shapeB);
This will only mask the instance of $shapeA
(depth=2), but not $shapeB
-instance (depth=3).
Much, much. But some things must be first done in ming/ming-perl itself.
Here is a list of todos:
Bold words are the default values.
object
: in FLASH 4 object.x
, but in Flash5 object._x
. So SWF::setVersion(4/5)
is important.
use SWF();
should automatically only import the used modules and CONSTANTS. Really needed?