com.flagstone.transform
Class FrameLabel

java.lang.Object
  extended by com.flagstone.transform.FrameLabel
All Implemented Interfaces:
Copyable<MovieTag>, SWFEncodeable, MovieTag

public final class FrameLabel
extends Object
implements MovieTag

FrameLabel defines a name for the current frame in a movie or movie clip.

The name can be referenced from other objects such as GotoFrame2 to simplify the creation of scripts to control movies by using a predefined name rather than the frame number. The label assigned to a particular frame should be unique. A frame cannot be referenced within a movie before the Player has loaded and displayed the frame that contains the corresponding FrameLabel object.

If a frame is defined as an anchor it may also be referenced externally when specifying the movie to play using a URL - similar to the way names links are used in HTML. When the Flash Player loads a movie it will begin playing at the frame specified in the URL.


Constructor Summary
FrameLabel(FrameLabel object)
          Creates a FrameLabel object with a copy of the label and anchor from another FrameLabel object.
FrameLabel(String aString)
          Creates a FrameLabel object with the specified name.
FrameLabel(String aString, boolean isAnchor)
          Creates a FrameLabel object with the specified name.
FrameLabel(SWFDecoder coder)
          Creates and initialises a FrameLabel object using values encoded in the Flash binary format.
 
Method Summary
 FrameLabel copy()
          Creates a complete copy of this object.
 void encode(SWFEncoder coder, Context context)
          Encode an object to the Flash binary format.
 String getLabel()
          Get the label for the frame.
 boolean isAnchor()
          Is the frame name is also used as an anchor so the frame can be referenced from outside of the movie.
 int prepareToEncode(Context context)
          Prepare an object for encoding, returning the expected size of an object when it is encoded.
 void setAnchor(boolean anchored)
          Sets the flag indicating whether the frame name is also used as an anchor so the frame can be referenced from outside of the movie.
 void setLabel(String aString)
          Sets the label.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FrameLabel

public FrameLabel(SWFDecoder coder)
           throws IOException
Creates and initialises a FrameLabel object using values encoded in the Flash binary format.

Parameters:
coder - an SWFDecoder object that contains the encoded Flash data.
Throws:
IOException - if an error occurs while decoding the data.

FrameLabel

public FrameLabel(String aString)
Creates a FrameLabel object with the specified name.

Parameters:
aString - the string that defines the label that will be assigned to the current frame. Must not be null or an empty string.

FrameLabel

public FrameLabel(String aString,
                  boolean isAnchor)
Creates a FrameLabel object with the specified name. If the isAnchor flag is true then the frame can be directly addressed by a URL and the Flash Player will begin playing the movie at the specified frame.

Parameters:
aString - the string that defines the label that will be assigned to the current frame. Must not be null or an empty string.
isAnchor - if true the name will be used as an anchor when referencing the frame in a URL.

FrameLabel

public FrameLabel(FrameLabel object)
Creates a FrameLabel object with a copy of the label and anchor from another FrameLabel object.

Parameters:
object - a FrameLabel object to copy.
Method Detail

getLabel

public String getLabel()
Get the label for the frame.

Returns:
the string used to label the frame.

setLabel

public void setLabel(String aString)
Sets the label.

Parameters:
aString - the string that defines the label that will be assigned to the current frame. Must not be null or an empty string.

isAnchor

public boolean isAnchor()
Is the frame name is also used as an anchor so the frame can be referenced from outside of the movie.

Returns:
true is the name can be used as an external reference to the frame.

setAnchor

public void setAnchor(boolean anchored)
Sets the flag indicating whether the frame name is also used as an anchor so the frame can be referenced from outside of the movie.

Parameters:
anchored - true if the frame is an anchor frame, false otherwise.

copy

public FrameLabel copy()
Creates a complete copy of this object.

Specified by:
copy in interface Copyable<MovieTag>
Returns:
a deep-copy of this object. New instances of mutable objects are copied and immutable instances are shared.

toString

public String toString()

Overrides:
toString in class Object

prepareToEncode

public int prepareToEncode(Context context)
Prepare an object for encoding, returning the expected size of an object when it is encoded. This method also used to initialise variables, such as offsets and flags that will be used when the object is encoded. Generally the method returns the size in bytes, however when called on objects that use bit fields such as shapes the methods will return the size in bits.

Specified by:
prepareToEncode in interface SWFEncodeable
Parameters:
context - an Context that allows information to be passed between objects to control how they are initialised for encoding.
Returns:
the size of the object when it is encoded.

encode

public void encode(SWFEncoder coder,
                   Context context)
            throws IOException
Encode an object to the Flash binary format.

Specified by:
encode in interface SWFEncodeable
Parameters:
coder - an SWFEncoder object.
context - an Context that allows information to be passed between objects to control how they are initialised for encoding.
Throws:
IOException - if an error occurs while encoding the object.


Copyright © 2002-2010 Flagstone Software Ltd.. All Rights Reserved.