Menu:

Sponsor

Discover Master of Alchemy, our first iPad/iPhone and iPod touch game!

 

Forum's topics

Latest Files

Archives

Top Rated

Categories

Photo Gallery


PHP::SWF Reader Example

Read and write SWF head tag

Other than retrieve all the main informations from a swf file there is the possibility to change some of the tags such as the framerate, protection, background, compression...
View the class' source file

source file: Here orignal swf file
SWF::stat() for source file:

Array
(
    [zlib-compression] => 1
    [fileType] => CWS
    [version] => 8
    [fileSize] => Array
        (
            [0] => 10523
            [1] => 22877
            [compressed] => 10523
            [real] => 22877
        )

    [frameRate] => 12
    [frameCount] => 30
    [movieSize] => Array
        (
            [0] => 400
            [1] => 300
            [width] => 400
            [height] => 300
        )

    [background] => Array
        (
            [0] => 0
            [1] => 204
            [2] => 255
            [hex] => #0CCFF
        )

    [protected] => 1
)
Now Save a new swf file using this code:
$flash->setFrameRate(90);
$flash->setCompression(0);
$flash->setBackgroundColor(155, 155, 155);
$flash->setProtected(0);
$flash->write("test_one.swf", 1);
						
Here the new swf file
SWF::stat() for destination file:
Array
(
    [zlib-compression] => 0
    [fileType] => FWS
    [version] => 8
    [fileSize] => Array
        (
            [0] => 22872
            [1] => 22875
            [compressed] => 22872
            [real] => 22875
        )

    [frameRate] => 90
    [frameCount] => 30
    [movieSize] => Array
        (
            [0] => 400
            [1] => 300
            [width] => 400
            [height] => 300
        )

    [background] => Array
        (
            [0] => 155
            [1] => 155
            [2] => 155
            [hex] => #9B9B9B
        )

    [protected] => 
)