1# ====================================================================
2# Copyright (c) 2000-2003 by Soheil Seyfaie. All rights reserved.
3# This program is free software; you can redistribute it and/or modify
4# it under the same terms as Perl itself.
5# ====================================================================
6
7# $Id$
8
9package SWF;
10use strict;
11use Carp 'croak';
12
13require DynaLoader;
14@SWF::ISA = qw(DynaLoader);
15
16$SWF::VERSION = '@MING_VERSION@';
17
18my @EXPORT_OK = qw(Action Bitmap Button Constants DisplayItem Fill Font Gradient Morph Movie MovieClip PrebuiltClip Shape Sound Text TextField FontCharacter ButtonRecord BinaryData InitAction Matrix Blur Shadow FilterMatrix Filter CXform Sprite BrowserFont FontCollection Character);
19
20bootstrap SWF $SWF::VERSION;
21
22sub import{
23	my $self = shift;
24	my @modules = @_;
25
26	my $package = (caller())[0];
27	my @failed;
28
29	foreach my $module (@modules) {
30		my $code = "package $package; ";
31		if($module eq ':ALL'){
32			map{$code .= "use SWF::$_; "} @EXPORT_OK;
33		}else{
34			$code .= "use SWF::$module;";
35		}
36
37		eval($code);
38		if ($@) {
39			warn $@;
40			push(@failed, $module);
41		}
42	}
43	@failed and croak "could not import qw(" . join(' ', @failed) . ")";
44}
45
46
471;
48__END__
49
50
51=head1 NAME
52
53SWF - an autoloadable interface module for Ming - a library for generating
54ShockWave Flash format movies.
55
56=head1 SYNOPSIS
57
58	# Don't import other modules
59	use SWF;
60
61	# import all SWF modules
62	use SWF qw(:ALL);
63
64	# import SWF::Shape and SWF::Movie only.
65	use SWF qw(Shape Movie);
66
67=head1 DESCRIPTION
68
69By default, SWF doesn't import other SWF classes. You may, however, instruct SWF to import all modules by using the following syntax:
70
71	use SWF qw(:ALL);
72
73=head1 METHODS
74
75=over 4
76
77=item SWF::setScale($scale);
78
79Sets scale to $scale.
80
81=item SWF::getScale();
82
83Get the current scale. 20 means 20 twips (1/20 of a pixel) and is the default value.
84
85=item SWF::setVersion($version);
86
87Sets SWF version for the header of flashfiles. Choose a value between 4 and 7 for your flashmovies. If you are unsure take 5.
88
89=item SWF::setCubicThreshold($num)
90
91Sets the threshold error for drawing cubic beziers.  Lower is more
92accurate, hence larger file size.
93
94=item SWF::setSWFCompression($level);
95
96Set output compression level.
97Returns previous value.
98$level is integer between 0 and 9.
99Note: This function is called automatic too by
100	$movie->save($filename[,$level]) and
101	$movie->output([$level])
102if the optional parameter $level is given.
103
104=item SWF::useConstants($flags);
105
106?
107
108=back
109
110=head1 AUTHOR
111
112Soheil Seyfaie (soheil at users.sourceforge.net).
113
114=head1 SEE ALSO
115
116SWF.pm related modules:
117SWF::Action, SWF::Bitmap, SWF::Button, SWF::Constants, SWF::DisplayItem, SWF::Fill, SWF::Font,
118SWF::Gradient, SWF::Morph, SWF::Movie, SWF::MovieClip, SWF::PrebuiltClip,
119SWF::Shape, SWF::Sound, SWF::TextField, SWF::Text, SWF::VideoStream, SWF::Sprite
120
121other projects:
122SWF::Builder  - a pure perl alternative to Ming
123
124=cut
125