The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

SWF::Search - Extract strings and information from Macromedia SWF files

SYNOPSIS

  use SWF::Search;

  my $search = SWF::Search->new(File=>"mymovie.swf");

  my @found  = $search("Spock");
  my @text   = $search->strings;

DESCRIPTION

This module allows the searching of Macromedia SWF files for text strings. The supported methods of searching for text are currently limited to strings within editable text fields, and frame labels. Future versions will support strings created by font-shape based text, and text used within actionscript expressions.

This initial release also does not support the compressed SWF files created by Flash MX.

METHODS

my $search = SWF::Search->new(File=>"mymovie.swf");

Instantiates and returns a new search object. Valid options are:

File => $filename

Selects a SWF file to search on.

CaseSensitive => 1/0

Turns search case sensitivity on or off. (Off by default.)

Debug => 1/0

Turns debugging messages on or off. (Off by default.)

$s->search("string" [,Type=>type, %options]);

Examines the SWF file for the given search term, and returns a list of text strings containing the term. If no search term is given, the method will return all found text strings in the file. A Type option may also be passed to the method, requesting that the search only be performed on a certain kind of text. The currently supported text types are All, EditText, and Label. If no Type option is given, the method defaults to searching All text. Additional options for the search may also be given. Currently, the only available option flag is CaseSensitive; searches are case-insensitive by default.

$s->strings();

Returns a list of text strings found in the SWF movie file.

$s->labels();

Returns a list of frame label text found in the SWF movie file.

$s->file($filename);

Sets and parses the filename on which to search if an argument is given, or returns the filename if called without an argument..

AUTHOR

Copyright 2002, Marc Majcher. All rights reserved.

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

Address bug reports and comments to: swf-search@majcher.com

This module is based on the OpenSWF specification and SDK released by Macromedia at http://www.macromedia.com/software/flash/open/licensing/fileformat/

SEE ALSO

SWF::File