28-03-00
Wooh, it has been a long time since I did any work on this. Well my new Linux box is sitting at home and my first exam is
out of the way and I now have another 5 weeks before the next load so I should be able to start cracking through stuff again.
I've stuck up a Development page which should be useful to anybody developing SWF stuff.
It's autogenerated by an ugly little Perl script I hacked up and, given a directory with some SWF files in,
knocks up a few tables with all the files with a particular tag and all the tags in a particular file plus
the least number of files you'll need to cover every tag and the smallest file for each tag.
08-03-00
Hmm, apparently I didn't fix File::Binary::getSBits properly as I'm having problems with negative values still.
Got a lot done today on Fonts and Text :- just DefineEditText and DefineFont2 to do now. Infact it's now easier
to list the tags I haven't done <grin>
DoAction
DefineSound
DefineButtonSound
SoundStreamBlock
DefineButtonCxform
DefineEditText
DefineMouseTarget
DefineSprite
DefineMorphShape
DefineFont2
AdpcmFillBuffer
AdpcmGetBits
AdpcmGetSBits
AdpcmDecompress
DecodeMp3Headers
DecodeMp3Frame
When all tags are being parsed correctly I need to ...
+ Sort out the Flash::Object so it's a little more useful
+ turn all data types and tags into seperate objects
+ Write an output filter that dumps stuff out exactly like swfparse
+ Write input and output filters for XML
+ use libswf and the Perl wrapper around it to write an SWF output filter
+ write an output filter that *only* dumps Sound, Images and Urls
+ start adding methods to tags and datatypes so they can be manipulated.
+ speed up parsing. Alot.
I've also uploaded a new version of File::Binary which is cleaned up, has Pod documentation and has an installer.
06-03-00
Fixed the problem with File::Binary::getSBits - signed bits are handled internally in Perl so reextending the
sign caused some weird errors. Done alot of work on ParseShape and its associated tags (ShapeStyle
and ShapeRecord). ShapeRecord gives me all the right lines defintions but the values are wrong. Most
confusing. When I finsih this I think I'll do the button tags then probably text and finally sound. It's gettign
there.
18-02-00
I think I've got DefineBitsLossless (and hence DefineBitsLossless2) all working now. and everything
appears to be working fine. Also started doing some work on ButtonRecords. That'll probably be my next task.
I've updated the tarballs with all the latest version of my stuff.
16-02-00
Well, I'm now cooking on gas as I'm doing this about 1 1/2 days a week. Rejigged File::Binary a bit more and Dave
Cantrell has also done some stuff to it but nothing major.
I've started to concentrate on the graphics tags a bit more :- I've done
DefineBits
JPEGTables
DefineBitsJPEG2
DefineBitsJPEG3
and the Parser now copes gracefully with a tag not being fully parsed which makes it a lot easy to experiment.
Started work on DefineBitsLosless as well but I'm having problems porting the C++ code I've got to Perl, I
can't work out how to get Compress::Zlib to work the same :(
Also had problems with ParseShapeStyle, I think there's a bug in File::Binary::getSBits that manifests when
returning negative values :- it works fine for positive ones.
It's all starting to come together though. We'll see how it goes.
03-11-99
Ooh, more tags done. And File::Binary's been completley rewritten so that it actually works with out falling over all
the time. Anyway .. currently parsed tags are ..
headers (still correct)
ShowFrame (with correct file offsets inserted)
StartSound
SetBackgroundColor
End
StopSound
Protect
FreeCharacter
PlaceObject
PlaceObject2
CXForm
^^^^^^^^^^^
sort of ... bit of problem with CXforms (?) which causes problems with
PlaceObject/2
Matrix
RemoveObject
RemoveObject2
PlaxeObject2
CXForm
Matrix
Color
Rect
SoundStreamHead
SoundStreamHead2
03-11-99
Found out that David Cantrell started a Perl Flash parser at pretty much exactly the same time as me. Bizarre ... you
wait for ages for a module to come along and suddenly two come along at once (mutter, mutter,
mutter). Anyway, he's got some really good ideas about module design so ...
Got quite a bit of work done today on the module. Just getting to grips with Perl's binary functions really. The
SWF::Parser currently can parse
headers (correctly now!)
SetBackgroundColor
FreeCharacter
PlaceObject
RemoveObject
RemoveObject2
PlaceObject2
I'll put up source when there's something more useful in there.
02-11-99
Well, the project has been approved by my college so I've officially started work on it. The first thing I did was
create a module for binary manipulation of a file, something that Perl was lacking. Heavily based on Michael Wallace's
code and the code of swfparse.cpp, currently it can only read arbitrary bits and bytes but I have written code to
allow you to write out to file which I haven't got round to testing yet. It does have one weird bug in that, under
Activestate Perl on NT, requesting a large number of bytes means that the file handle starts returning nothing. Since
I only discovered this last night (2nd of November) I haven't looked into it properly. It works fine under FreeBSD, my
other test platform. Hey ho, another thing on the 'to-do' list.
I've also hacked out the structure of the object and two Parser filters. Flash::SWF::Parser reads in an SWF file,
correctly extracting all the tag types (but doesn't decode the data of the tags yet). It also extracts the header
information although it's a little screwy ATM. Flash::swfparse::Writer dumps out the file in the same format as
swfparse, again it can't handle the data of the tag yet.
This is my first, large scale Perl project and as such the design of the Modules and their APIs is a little crap and
subject to change at any time. Any functions that are in there at the moment are probably badly written (which is
pretty much par for the course with my Perl code).