Pwiff Update

I just committed a simple Movie and Encoder class, so making a blank movie is now far easier to understand. At least now you don’t have to calculate the file length by hand. :-P

$env = new Pwiff_Environment;
$env->setSwfVersion(10);

$movie = new Pwiff_Movie($env);
$movie->setFrameSize(100, 100);
$movie->setFrameRate(0);

$enc = new Pwiff_Encoder($movie, new Pwiff_Output_File('test.swf'));
$enc->encode();

The first step is to define an environment, which creates a context for encoding (and later decoding). By setting the version, certain tags or tag attributes could be ignored when reading or writing, if they are in a higher version than what you set. Then, you define a movie object, and set some of its properties, like the frame size and frame rate. After that, you would do more fancy things (when they get written, though you can addTag() with it right now). Finally, set up an encoder, passing the movie and output objects, and call encode(), which will write it with the given output instance (in this case, to the file test.swf).

This entry was posted in PHP and tagged , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>