GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  SWF::PARSER (3)

.ds Aq ’

NAME

SWF::Parser - Parse SWF file.

CONTENTS

SYNOPSIS



  use SWF::Parser;

  $parser = SWF::Parser->new( header-callback => \&header, tag-callback => \&tag);
  # parse binary data
  $parser->parse( $data );
  # or parse SWF file
  $parser->parse_file( flash.swf );



DESCRIPTION

SWF::Parser module provides a parser for SWF (Macromedia Flash(R)) file. It splits SWF into a header and tags and calls user subroutines.

    METHODS

SWF::Parser->new( ’header-callback’ => \&headersub, ’tag-callback’ => \&tagsub [, stream => $stream, header => ’no’]) Creates a parser. The parser calls user subroutines when find SWF header and tags. You can set SWF::BinStream::Read object as the read stream. If not, internal stream is used. If you want to parse a tag block without SWF header, set header => ’no’.
&headersub( $self, $signature, $version, $length, $xmin, $ymin, $xmax, $ymax, $framerate, $framecount ) You should define a header-callback subroutine in your script. It is called with the following arguments:



  $self:       Parser object itself.
  $signature:  FWS for normal SWF and CWS for compressed SWF.
  $version:    SWF version No.
  $length:     File length.
  $xmin, $ymin, $xmax, $ymax:
     Boundary rectangle size of frames, ($xmin,$ymin)-($xmax, $ymax), in TWIPS(1/20 pixels).
  $framerate:  The number of frames per seconds.
  $framecount: Total number of frames in the SWF.



&tagsub( $self, $tagno, $length, $datastream ) You should define a tag-callback subroutine in your script. It is called with the following arguments:



  $self:       Parser object itself.
  $tagno:      The ID number of the tag.
  $length:     Length of tag.
  $datastream: The SWF::BinStream::Read object that can be read the rest of tag data.



$parser->parse( $data ) parses the data block as a SWF. Can be called multiple times.
$parser->parse_file( $file ); parses a SWF file. The argument can be a filename or an already opened file handle.
$parser->parseheader; parses a SWF header and calls &headersub. You don’t need to call this method specifically because this method is usually called from parse method.
$parser->parsetag; parses SWF tags and calls &tagsub. You don’t need to call this method specifically because this method is usually called from parse method.
$parser->abort; tells the parser to abort parsing.

COPYRIGHT

Copyright 2000 Yasuhiro Sasama (ySas), <ysas@nmt.ne.jp>

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

SWF::BinStream, SWF::Element

SWF file format specification from Macromedia.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 SWF::PARSER (3) 2016-03-17

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.