com.flagstone.transform
Class FSFrame

java.lang.Object
  extended by com.flagstone.transform.FSFrame

public final class FSFrame
extends java.lang.Object

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 FSGotoFrame2 object can be used to move to a named frame when playing a movie or movie clip. definitions - An array containing objects that define items for display in a movie. Definitions are sub-classes of the FSDefineObject class and define shapes, fonts, images and sounds that are displayed or played by the Flash Player. commands - An array containing objects that define commands that affect the display list or the Flash Player directly. actions - An array that define actions that are executed when a frame is displayed. Frame objects simplify the handling of movies. FSDoAction, FSFrameLabel and FSShowFrame classes can now "hidden" from view. They are generated automatically by the FSFrame object when it is added to an FSMovie object. The framesFromMovie(FSMovie aMovie) method allows an existing movie to be viewed as an array of FSFrame 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 FSMovie. The easiest way to do this is to remove the existing objects from the movie and add all the frames. ArrayList frames = FSFrame.framesFromMovie(aMovie); ... ... aMovie.getObjects().clear(); for (Iterator i = frames.iterator(); i.hasNext();) ((FSFrame)i.next()).addToMovie(aMovie); When the contents of an FSFrame object is added to a movie if a label defined then an FSFrameLabel object will be added. Similarly if actions are defined then an FSDoAction object will be added. An FSShowFrame object which instructs the Flash Player to update the display list with all the changes is added.


Constructor Summary
FSFrame()
          Constructs an empty frame with no label defined and the definitions, commands and actions arrays empty.
FSFrame(java.lang.String label, java.util.ArrayList definitions, java.util.ArrayList commands, java.util.ArrayList actions)
          Constructs a frame with with the specified label, definitions, commands and actions.
 
Method Summary
 void addAction(FSActionObject anObject)
          Adds the action object to the frame.
 void addCommand(FSMovieObject anObject)
          Adds the display list command to the frame.
 void addDefinition(FSDefineObject anObject)
          Adds an object to the frame that defines an object to be displayed in the movie.
 void addToMovie(FSMovie aMovie)
          Add the objects in the frame to the movie.
static java.util.ArrayList framesFromMovie(FSMovie aMovie)
          Create a frame based view of a movie.
 java.util.ArrayList getActions()
          Gets the array of action objects that will be execute when the frame is displayed.
 java.util.ArrayList getCommands()
          Gets the array of commands that update the display list.
 java.util.ArrayList getDefinitions()
          Gets the array of definition objects contained in the frame.
 java.lang.String getLabel()
          Gets the label assigned to the frame.
 void setActions(java.util.ArrayList anArray)
          Sets the array of action objects for the frame.
 void setCommands(java.util.ArrayList anArray)
          Sets the array of commands that updated the display list for the frame.
 void setDefinitions(java.util.ArrayList anArray)
          Sets the array of action objects for the frame.
 void setLabel(java.lang.String aString)
          Sets the label for the frame.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FSFrame

public FSFrame()
Constructs an empty frame with no label defined and the definitions, commands and actions arrays empty.


FSFrame

public FSFrame(java.lang.String label,
               java.util.ArrayList definitions,
               java.util.ArrayList commands,
               java.util.ArrayList actions)
Constructs a frame with with the specified label, definitions, commands and actions. The label is optional and may be set to null if no label is defined. Similarly if no definitions, commands or actions are defined for a given frame then the corresponding argument may be set to null.

Parameters:
label - a label for the frame. Maybe null if no label is defined.
definitions - an array of definition objects. Maybe null if no definitions are defined.
commands - an array of objects used to manipulate the display list. Maybe null if no display list commands are defined.
actions - an array of action objects that will be executed when the frame is displayed. Maybe null if no actions are defined.
Method Detail

framesFromMovie

public static java.util.ArrayList framesFromMovie(FSMovie aMovie)
Create a frame based view of a movie. Objects from the movie are grouped into Frame objects. Objects from the movie are added to the frame so any changes made are reflected in the movie. However objects added or removed from a frame are not reflected in the movie.

Parameters:
aMovie - an FSMovie object.
Returns:
an array of Frame objects.

addAction

public void addAction(FSActionObject anObject)
Adds the action object to the frame.

Parameters:
anObject - the action object to be added to the frame.

addDefinition

public void addDefinition(FSDefineObject anObject)
Adds an object to the frame that defines an object to be displayed in the movie.

Parameters:
anObject - a sub-class of FSDefineObject.

addCommand

public void addCommand(FSMovieObject anObject)
Adds the display list command to the frame.

Parameters:
anObject - an FSMovieObject the manipulates the display list.

getLabel

public java.lang.String getLabel()
Gets the label assigned to the frame.

Returns:
the label.

getDefinitions

public java.util.ArrayList getDefinitions()
Gets the array of definition objects contained in the frame.

Returns:
the array of definitions.

getCommands

public java.util.ArrayList getCommands()
Gets the array of commands that update the display list.

Returns:
the array of commands objects.

getActions

public java.util.ArrayList getActions()
Gets the array of action objects that will be execute when the frame is displayed.

Returns:
the array of actions defined for the frame.

setLabel

public void setLabel(java.lang.String aString)
Sets the label for the frame.

Parameters:
aString - the label.

setDefinitions

public void setDefinitions(java.util.ArrayList anArray)
Sets the array of action objects for the frame.

Parameters:
anArray - the array of actions.

setCommands

public void setCommands(java.util.ArrayList anArray)
Sets the array of commands that updated the display list for the frame. The changes are visible when the frame is displayed.

Parameters:
anArray - the array of command objects.

setActions

public void setActions(java.util.ArrayList anArray)
Sets the array of action objects for the frame.

Parameters:
anArray - the array of actions.

addToMovie

public void addToMovie(FSMovie aMovie)
Add the objects in the frame to the movie. The contents of the definitions and commands arrays are added to the movie. If a label is assigned to the frame then an FSFrameLabel object is added to the movie. If actions are defined then an FSDoAction object is added containing the actions defined in the frame.

Parameters:
aMovie - an FSMovie object.