SWFMovie$m = new SWFMovie();
$m = new SWFMovie(version);Create a new movie object of version version. Default version is 4.version doesn't really do anything yet. But later will cause the movie to emit an swf file compatible with older players.
$m->output();
Dumps your lovingly prepared movie out. Preceding this with the commandheader('Content-type: application/x-shockwave-flash');convinces the browser to display this as a flash movie.$i = $m->add($c);
Add any type of data to a movie. Shapes, text, fonts, etc. must all be add'ed to the movie to make this work. In fact, fonts have to be added before the text that depends on them..For displayable types (shape, text, button, sprite), this returns a handle to the object in a display list. Thus, you can add the same shape to a movie multiple times and get separate handles back for each separate instance. See SWFDisplayItem (that's what the handle's called, though you'd never need to know that) below.
$m->remove($i); ??
Remove the object instance from the display list.$m->nextFrame();
Move to the next frame of the animation.$m->labelFrame(label);
Names the current frame. Useful for gotoFrame and callFrame actions.$m->setBackground(r, g, b);
Set the background color. Why is there no rgba version? Think about it.(Actually, that's not such a dumb question after all- you might want to let the html background show through. There's a way to do that, but it only works on IE4. Search the MM site for details.)
$m->setRate(framesPerSecond);
Set the frame rate. Animation will slow down if the player can't generate frames fast enough- unless there's a streaming sound (yeah, good luck), in which case display frames are sacrificed to keep sound from skipping.$m->setDimension(width, height);
Set the movie's size.$m->setFrames(numberOfFrames);
Set the total number of frames in the animation. If you call nextFrame more times than this number, you get kernel panic.Not really, it just adds more frames.
$m->streamSound(filename);
Stream the named mp3 file. Not very robust in dealing with oddities (can skip over an initial ID3 tag, but that's about it). Like SWFShape::addJpegFill, this isn't a stable function- we'll probably need to make a separate SWFSound object to contain sound types.Note that the movie isn't smart enough to put enough frames in to contain the entire mp3 stream- you'll have to add (length of song * frames per second) frames to get the entire stream in.
SWFSprite..also known as a "movie clip", this allows one to create objects which are animated in their own timelines. Hence, the sprite has most of the same methods as the movie.
$p = new SWFSprite();
Create a new SWFSprite object.$i = $p->add($c);Add a shape, text, a button, an action, or another sprite to the sprite.For displayable types (shape, text, button, sprite), this returns a handle to the object in a display list.
$p->remove($i); ??
Remove the object instance from the display list.$p->nextFrame();
Move to the next frame of the animation.$p->labelFrame(label);
Names the current frame. Useful for gotoFrame and callFrame actions.$p->setFrames(numberOfFrames);
Set the total number of frames in the sprite's animation.
SWFDisplayItemHere's where all the animation takes place. After you define a shape, a text object, a sprite, or a button, you add it to the movie, then use the returned handle to move, rotate, scale, or skew the thing.
Since you're smart boys and girls (or maybe I'm just lazy), the "blahTo" versions of functions below do whatever in absolute terms, while the mere "blah" variety is relative. That is, rotate(45) turns the object 45 degrees from wherever it is now, while rotateTo(45) turns the object to 45 degrees from its defined orientation.
$i->moveTo(x, y);
$i->move(x, y);Move object to/displace by (x,y) in global coordinates.$i->scaleTo(x, y);
$i->scale(x, y);Set/multiply scale by x in the x-direction, y in the y-direction.$i->rotateTo(degrees);
$i->rotate(degrees);Set rotation to/rotate by degrees degrees.$i->skewXTo(x);
$i->skewX(x);Set/add x-skew x. 1.0 is a 45-degree forward slant. More is more forward, less is more backward.$i->skewY(y);
$i->skewYTo(y);Set/add y-skew y. 1.0 is a 45-degree upward slant. More is more upward, less is more downward.$i->setDepth(depth);
Set z-order to depth. Depth defaults to the order in which instances are created (by add'ing a shape/text to a movie)- newer ones are on top of older ones. If two objects are given the same depth, only the later-defined one can be moved.$i->remove();
Remove this object from the movie's display list.$i->setName(name);
Set the object's name to name. Probably only useful for sprites.$i->setRatio(ratio);
Set the object's ratio to ratio. Obviously only useful for morphs.
All content Copyright (C) 2000 Opaque Industries except where noted otherwise.