com.flagstone.transform.action
Class With

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

public final class With
extends Object
implements Action

With is a stack-based action and supports the with statement from the ActionScript language.

 with(_root.movieClip) {
     gotoAndPlay("frame");
 }
 

The action temporarily selects the movie clip allowing the following stream of actions to control the movie clip's time-line.


Constructor Summary
With(List<Action> list)
          Creates a With object with a list of actions.
With(SWFDecoder coder, Context context)
          Creates and initialises a With action using values encoded in the Flash binary format.
With(With object)
          Creates and initialises a With action using the values copied from another With action.
 
Method Summary
 With copy()
          Creates a complete copy of this object.
 void encode(SWFEncoder coder, Context context)
          Encode an object to the Flash binary format.
 List<Action> getActions()
          Get the list of actions that are executed for the movie clip target.
 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

With

public With(SWFDecoder coder,
            Context context)
     throws IOException
Creates and initialises a With action using values encoded in the Flash binary format.

Parameters:
coder - an SWFDecoder object that contains the encoded Flash data.
context - a Context object used to manage the decoders for different type of object and to pass information on how objects are decoded.
Throws:
IOException - if an error occurs while decoding the data.

With

public With(List<Action> list)
Creates a With object with a list of actions.

Parameters:
list - the list of action objects. Must not be null.

With

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

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

getActions

public List<Action> getActions()
Get the list of actions that are executed for the movie clip target.

Returns:
a copy of the list of actions that will be executed.

copy

public With 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.