com.flagstone.transform.action
Class SetTarget

java.lang.Object
  extended by com.flagstone.transform.action.SetTarget
All Implemented Interfaces:
Action, Copyable<Action>, SWFEncodeable

public final class SetTarget
extends Object
implements Action

SetTarget selects a movie clip to allow its time-line to be controlled. The action performs a "context switch". All following actions such as GotoFrame, Play, etc. will be applied to the specified object until another SetTarget action is executed. Setting the target to be the empty string ("") returns the target to the movie's main time-line.


Constructor Summary
SetTarget(SetTarget object)
          Creates and initialises a SetTarget action using the values copied from another SetTarget action.
SetTarget(String aString)
          Creates a SetTarget action that changes the context to the specified target.
SetTarget(SWFDecoder coder)
          Creates and initialises a SetTarget action using values encoded in the Flash binary format.
 
Method Summary
 SetTarget copy()
          Creates a complete copy of this object.
 void encode(SWFEncoder coder, Context context)
          Encode an object to the Flash binary format.
 String getTarget()
          Get the name of the target movie clip.
 int prepareToEncode(Context context)
          Prepare an object for encoding, returning the expected size of an object when it is encoded.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SetTarget

public SetTarget(SWFDecoder coder)
          throws IOException
Creates and initialises a SetTarget action 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.

SetTarget

public SetTarget(String aString)
Creates a SetTarget action that changes the context to the specified target.

Parameters:
aString - the name of a movie clip. Must not be null.

SetTarget

public SetTarget(SetTarget object)
Creates and initialises a SetTarget action using the values copied from another SetTarget action.

Parameters:
object - a SetTarget action from which the values will be copied.
Method Detail

getTarget

public String getTarget()
Get the name of the target movie clip.

Returns:
the name of the movie clip.

copy

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

Specified by:
copy in interface Copyable<Action>
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.