60
=item $m = new SWF::Movie()
62
Creates a Movie object.
64
=item $m = newSWFMovieWithVersion(version)
66
Creates a Movie object with version value (e.g. 8) set.
68
=item $displayItem=$m->add($SWFObject)
61
70
Add an instance of a SWF-object to your current frame. The returnvalue is a SWF::DisplayItem.
63
Possible SWF-objects are:
72
Some possible SWF-objects are:
72
83
$m->add($shape); # possible, but not more accessible for us
73
84
$shape_1 = m->add($shape); # good instance
75
=item addExport(SWF::Block, name)
77
??? what this method is good for ???
79
=item remove(SWF::DisplayItem)
81
Removes the given instance from the current and following frames of the main timeline.
86
=item $m->addExport($block, $name)
88
Prepare linkage to Action script code.
90
$m->addExport($mc, 'mc');
91
# and later inside action script....:
92
$ac = new SWF::Action("_root.attachMovie('mc','mc1',11);");
94
=item $m->writeExports()
96
Export prepared names to Action script.
98
=item remove($displayItem)
100
Removes the given SWF::DisplayItem instance from the current and following frames of the main timeline.
83
102
$m->remove($shape_i);
87
Finish a frame of the main timeline. New added objects will be added in the next frame.
106
Finish a frame of the main timeline. New added objects will be added in the next frame.
110
=item setNumberOfFrames($frames)
111
=item setFrames($frames)
93
113
Preset the number of frames of the main timeline. n not used frames before finishing the movie will filled with n nextFrame() statements.
94
114
If you inserted more nextFrame() commands than you set with setFrames() the setFrames() will be ignored.
96
116
$m->setFrames(100);
98
=item setBackground(red,green,blue)
118
=item $m->setBackground($red,$green,$blue)
100
120
Set the background in red, green, blue values. Possible value are 0..255 or hexvalues 0x0..0xff.
105
125
A transparency level isn't available I asume. (In Flash MX/F6?). A transparent background can be set in the HTML-code for Internet Explorer. Please
106
126
inform the Authors if that is available for nonIE-browsers.
108
=item setDimension(x,y)
128
=item $m->namedAnchor($label)
130
This function adds a named anchor to the movie.
132
=item $m->setDimension(x,y)
110
134
Set the dimension in pixel.
112
#We should implement this in ming c-lib!!
113
137
#min: (0.0,0.0) # ;-)
115
139
#default: (0.0?,0.0?)
116
140
#Behavior when values <min: ming sets it to min
117
141
#Behavior when values >max: ming sets it to max
119
143
$m->setDimension(200,100);
120
144
$m->setDimension(123.45,67.89);
146
=item $m->setRate(int)
124
148
Set the playing speed in frames/second.
126
#We should implement this in ming c-lib!!
130
154
#Behavior when value <min: ming sets it to min
131
155
#Behavior when value >max: ming sets it to max
137
161
A feature that prevents only flashnewbies from importing your movie into Macromedias Flash authoring tools. It cannot protect your content from being loaded by
138
162
other flashmovies, deleting of the protection with a hexeditor or disassembling with tools.
142
=item setSoundStream(SWF::Sound)
144
Puts an SWF::Sound object as streaming sound into the main timeline.
146
$m->setSoundStream($sound);
148
=item streamMp3(filename)
164
=item $m->setSoundStream($soundstream, [$skip])
166
Puts an SWF::SoundStream object as streaming sound into the main timeline.
167
The optional skip parameter describes the time in seconds to be skiped.
169
$m->setSoundStream($soundstream);
171
=item $m->streamMp3($filename)
150
173
Simplifies the setSoundStream(). You only need the filename.
152
$m->("iloveyou.mp3");
154
Hint: If you want to reuse this sound/mp3 later in this movie, create a reusable SWF::Sound object and then put it into setSoundstream().
156
=item labelFrame(string)
175
$m->streamMp3("iloveyou.mp3");
177
Hint: If you want to reuse this sound/mp3 later in this movie, create a reusable SWF::SoundStream object and then put it into setSoundstream().
179
=item $soundinstance = $m->startSound($sound)
181
Play a prepared SWF::Sound object into the main timeline. Returns an object of SWF::SoundInstance.
183
$sound = new SWF::Sound("loveyoutoo.mp3", SWF_SOUND_MP3_COMPRESSED );
184
$si = $m->startSound($sound);
186
=item $m->stopSound($sound)
190
=item $m->labelFrame($string)
158
192
Gives the current frame a label that can be used by actionscript as anchor. Then you don't have to count your nextFrame() lines anymore. :-)
160
194
$m->labelFrame("win");
162
196
#max characters of a label???
163
197
#What happen if we put there a big string??
164
198
#Which characters are allowed??
166
=item output([int compresslevel])
200
=item $m->setScriptLimits($maxRecursion, $timeout)
202
Set limits for resource usage, related to action script. Setting timeout will protect your computer from too long loops
203
and stack overflow. So endless scripts like "while (1){};" will be interrupted after timeout seconds. The default
204
recursion depth is 265, the default timeout is 15 seconds.
206
=item $m->defineScene($offset, $name)
208
Define scenes for the movies' main timeline using integer value for frame offset and name of the scene.
210
=item $m->setNetworkAccess($flag)
212
Sets network / fileaccess policy. If the flag is set to 0 a localy loaded
213
movie will be unable to access the network but is allowed to access local files.
214
If the flag ist set to 1 a localy loaded movie will be unable to access local files
215
but is allowed to access the network. For SWF >= 8: default is 0,
217
=item $m->addMetadata($xml)
219
Adds Metadata to the movie: this function inserts a metadata-tag
220
into the movie. Only one metadata-tag can be set to a movie.
221
Metadata is specified as an XML string.
223
=item $m->assignSymbol($character, $name)
225
Assigns a symbolic name for a SWF::Character object.
226
Such classes are available for usage in other SWF files
227
and can be referenced from inside the current movie.
228
To assign a symbol to the root movie use NULL as character value.
230
=item $m->setTabIndex($depth, $index)
232
Sets tab index for specified depth level.
234
=item $fontchar = $m->addFont($font)
236
Adds a font to a movie. An object of SWF::FontCharacter class returned.
238
$font = new SWF::Font('Arial.fdb');
239
$fch = $m->addFont($font);
241
=item $fontchar = $m->importFont($file, $name)
243
Imports a font from an other SWFFile. An object of SWF::FontCharacter class returned.
245
$fch = $m->importFont('textField.swf', 'Arial337a');
247
=item $m->importCharacter($url, $name)
249
Not yet documented (ToDo!)
251
=item $result = $m->replace($item, $block)
253
This method replaces a displayable character with a new one.
254
Returns 0 on success , -1 else.
256
$dispitem = $movie->add($shape1);
258
print $movie->replace($dispitem, $shape2);
261
=item $written = $m->xs_output([$compresslevel])
263
=item $written = $m->output([$compresslevel])
168
265
Writes the SWF::Movie to stdout. This is normally used for webservers/cgi-scripts.
169
266
Don't forget to send the "Content-Type:"-lines before writing out the movie.
171
268
The parameter compresslevel is optional. compresslevel between 0 and 9. Higher values will be interpreted as 9. Values smaller 0
172
269
mean no compression. By default the SWF::Movie will be send without compression.
174
270
Notice: compression available since Flash MX(Flash 6). Ming does not check this for you if you write flash4 or flash5 movies.
176
=item save(filename [, int compresslevel])
178
Save the SWF::Movie to a file.
272
Unlike xs_output() the output() method prepared for using via webservers (but not limited to webservers).
274
Both methods return number of bytes written.
276
=item $written = $m->save($filename [, $compresslevel])
278
Method saves the SWF::Movie to a file and returns the number of bytes written.
180
279
The parameter compresslevel is optional. compresslevel between 0 and 9. Higher values will be interpreted as 9. Values smaller 0
181
280
mean no compression. By default the SWF::Movie will be saved without compression.
183
281
Notice: compression available since Flash MX(Flash 6). Ming does not check this for you if you write flash4 or flash5 movies.
247
344
print "Content-type: application/x-shockwave-flash\n\n";
249
345
$m->output(9); # with compression level 9 (since flash6)
255
Soheil Seyfaie (soheil at users.sourceforge.net).
351
Soheil Seyfaie (soheil at users.sourceforge.net), Albrecht Kleine and
352
developers of ming.sourceforge.net
259
SWF, SWF::Action, SWF::Bitmap, SWF::Button, SWF::Constants, SWF::DisplayItem, SWF::Fill, SWF::Font, SWF::Gradient, SWF::Morph, SWF::Movie, SWF::Shape, SWF::Sound, SWF::Sprite, SWF::TextField, SWF::Text
356
SWF, SWF::Action, SWF::Bitmap, SWF::Button, SWF::Constants, SWF::DisplayItem, SWF::Fill,
357
SWF::Font, SWF::FontCharacter, SWF::Gradient, SWF::Morph, SWF::MovieClip, SWF::Shape,
358
SWF::PrebuiltClip, SWF::Sound, SWF::SoundStream, SWF::TextField, SWF::Text, SWF::Filter, SWF::Character