|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.flagstone.transform.util.movie.Frame
public final class Frame
The Frame class is used to provide a higher level view of a movie. Rather than viewing movies as a sequence of individual objects each representing a given data structure in the encoded Flash file, objects can be grouped together in frames which presents a more logical view of a movie and makes movie manipulation and search for specific objects easier to handle.
Each Frame object has the following attributes:
number - The position in the movie when the frame will be displayed.
label - An optional name assigned to a frame. The GotoFrame2 object
can be used to move to a named frame when playing a movie or movie clip.
definitions - A list containing objects that define items for
display in a movie. Definitions are sub-classes of the Definition class and
define shapes, fonts, images and sounds that are displayed or played by the
Flash Player.
commands - A list containing objects that define commands that
affect the display list or the Flash Player directly.
actions - A list that define actions that are executed when a
frame is displayed.
Frame objects simplify the handling of movies. DoAction, FrameLabel and ShowFrame classes can now "hidden" from view. They are generated automatically by the Frame object when it is added to an Movie object.
The framesFromMovie(Movie aMovie) method allows an existing movie to be viewed as a list of Frame objects. Objects from the movie are copied into each frame so changes made to the attributes of each object are reflected in the movie. The frame objects are not synchronised with the movie, so any objects added to a frame are not added to the Movie. The easiest way to do this is to remove the existing objects from the movie and add all the frames.
ArrayList frames = Frame.framesFromMovie(aMovie);
...
...
aMovie.getObjects().clear();
for (Iterator i = frames.iterator(); i.hasNext();) {
((Frame)i.next()).addToMovie(aMovie);
}
When the contents of an Frame object is added to a movie if a label defined then an FrameLabel object will be added. Similarly if actions are defined then an DoAction object will be added. An ShowFrame object which instructs the Flash Player to update the display list with all the changes is added.
| Constructor Summary | |
|---|---|
Frame()
Creates a empty frame with no label defined and the definitions, commands and actions lists empty. |
|
Frame(int frame)
Creates a empty frame with no label defined and the definitions, commands and actions lists empty. |
|
| Method Summary | |
|---|---|
void |
addAction(Action anObject)
Adds the action object to the frame. |
void |
addCommand(MovieTag anObject)
Adds the display list command to the frame. |
void |
addDefinition(MovieTag anObject)
Adds an object to the frame that defines an object to be displayed in the movie. |
void |
addToMovie(Movie aMovie)
Add the objects in the frame to the movie. |
List<Action> |
getActions()
Returns the array of action objects that will be execute when the frame is displayed. |
List<MovieTag> |
getCommands()
Returns the list of commands that update the display list. |
List<MovieTag> |
getDefinitions()
Returns the list of definition objects contained in the frame. |
String |
getLabel()
Returns the label assigned to the frame. |
int |
getNumber()
Get the number of the frame. |
void |
setActions(List<Action> list)
Sets the list of action objects for the frame. |
void |
setCommands(List<MovieTag> list)
Sets the list of commands that updated the display list for the frame. |
void |
setDefinitions(List<MovieTag> list)
Sets the list of action objects for the frame. |
void |
setLabel(String aString)
Sets the label for the frame. |
void |
setNumber(int frameNumber)
Sets the number for the frame. |
static List<Frame> |
split(Movie aMovie)
Create a frame based view of a movie. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Frame()
public Frame(int frame)
frame - the frame number.| Method Detail |
|---|
public static List<Frame> split(Movie aMovie)
aMovie - an Movie object.
public void addAction(Action anObject)
anObject - the action object to be added to the frame. Must not be null.public void addDefinition(MovieTag anObject)
anObject - a sub-class of Definition. Must not be null.public void addCommand(MovieTag anObject)
anObject - an MovieTag the manipulates the display list. Must not be
null.public int getNumber()
public String getLabel()
public List<MovieTag> getDefinitions()
public List<MovieTag> getCommands()
public List<Action> getActions()
public void setNumber(int frameNumber)
frameNumber - the frame number.public void setLabel(String aString)
aString - the label.public void setDefinitions(List<MovieTag> list)
list - the list of actions. Must not be null.public void setCommands(List<MovieTag> list)
list - the list of command objects. Must not be null.public void setActions(List<Action> list)
list - the list of actions. Must not be null.public void addToMovie(Movie aMovie)
aMovie - an Movie object. Must not be null.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||