## ## a flash file is really an array of tags.. ## start by reading in the header ## then loop through the tags ## ## to save speed, keep the tags in the binary form ## but you can match them against the taglist.. ## ## write the header, ## loop through a third time, ## writing all the tags. ## ## seek to top of file, and write the file size. ## use Flash::SWF; use strict; my $vog = new Flash::SWF "test.swf"; $vog->{debug}=1; $vog->writefile("out.swf"); #my $vog = new Flash::SWF "vogwar.swf"; #print "====\n"; __END__ $stream = pack "C*", (99, 100, 5, 101, 102, 102, 104, 105); print $stream, "\n\n"; while (length($stream)){ ($char, $stream) = unpack "AA*", $stream; print "$char $stream\n"; } #print ord("3"); __END__ ## read the file my @stream = (); &readheader(); push @stream, &gettag() __END__ ## write to the file ## open SWF, ">bubba.swf" or die "couldn't create file."; binmode SWF; $filesize = 0; $width = 500; $height = 400; $framerate = 12; $framecount = 1; print SWF # the header: pack( "C4L", "FWS3", $filesize, $width, $height, $framerate, $framecount);