com.flagstone.transform.action
Class WaitForFrame2

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

public final class WaitForFrame2
extends Object
implements Action

The WaitForFrame2 action instructs the player to wait until the specified frame number or named frame has been loaded.

If the frame has been loaded then the following n actions are executed. The WaitForFrame2 action extends the WaitForFrame action by allowing the name of a frame to be specified.

WaitForFrame2 is a stack-based action. The frame number or frame name which should be loaded to trigger execution of the following actions is popped from the Flash Player's stack. Note however that this method of waiting until a frame has been loaded is considered obsolete. Determining the number of frames loaded using the FramesLoaded property of the Flash player in combination with an If action is now preferred.

See Also:
Push, If

Constructor Summary
WaitForFrame2(int count)
          Creates a WaitForFrame2 object with the number of actions to execute if the frame has been loaded.
WaitForFrame2(SWFDecoder coder)
          Creates and initialises a WaitForFrame2 action using values encoded in the Flash binary format.
WaitForFrame2(WaitForFrame2 object)
          Creates and initialises a WaitForFrame2 action using the values copied from another WaitForFrame2 action.
 
Method Summary
 WaitForFrame2 copy()
          Creates a complete copy of this object.
 void encode(SWFEncoder coder, Context context)
          Encode an object to the Flash binary format.
 int getActionCount()
          Returns the number of actions to execute.
 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

WaitForFrame2

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

WaitForFrame2

public WaitForFrame2(int count)
Creates a WaitForFrame2 object with the number of actions to execute if the frame has been loaded.

Parameters:
count - the number of actions to execute. Must be in the range 0..255.

WaitForFrame2

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

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

getActionCount

public int getActionCount()
Returns the number of actions to execute.

Returns:
the number of actions, (not encoded bytes).

copy

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