SWFMovie


SWFMovie SWFMovie();
SWFMovie SWFMovie(int version);

Constructors.
Create a new movie object, representing an SWF version 4 movie.


void setRate(float frameRate);
void Rate;

Set the frame rate. Animation will slow down if the player can't render frames fast enough- unless there's a streaming sound, in which case display frames are sacrificed to keep sound from skipping.


void setDimension(float width, float height);
Set the movie's width and height.


void setFrames(int numberOfFrames);
void setNumberOfFrames(int numberOfFrames);
void Frames;
void NumberOfFrames;

Set the total number of frames in the animation.


void addExport(SWFBlock block, string name);
Add any type of data to a movie. Shapes, text, fonts, etc. must all be add'ed to the movie to make this work.


void setBackground(int r, int g, int 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.)



void streamMp3(SWFSound sound);
void streamMp3(string soundfilename);
void setSoundStream(SWFSound sound);
void SoundStream; (Propertie)

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.



SWFDisplayItem add(SWFBlock block);
Add any type of data to a movie. Shapes, text, fonts, etc. must all be add'ed to the movie to make this work.

For displayable types (shape, text, button, sprite), this returns an SWFDisplayItem, 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.



void remove(SWFDisplayItem i);
Remove the object instance from the display list.


void nextFrame(SWFMovie m);
Move to the next frame of the animation.


void labelFrame(string label);
Label to frame of the animation.


int output();
int outputToFile(string filename);

Dumps your lovingly prepared movie out.


int save(string filename);
Saves your movie to the named file.


back to index