com.flagstone.transform
Class FSActionObject

java.lang.Object
  extended by com.flagstone.transform.FSTransformObject
      extended by com.flagstone.transform.FSActionObject
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
FSAction, FSCall, FSExceptionHandler, FSGetUrl, FSGetUrl2, FSGotoFrame, FSGotoFrame2, FSGotoLabel, FSIf, FSJump, FSNewFunction, FSNewFunction2, FSPush, FSRegisterCopy, FSSetTarget, FSTable, FSUnknownAction, FSWaitForFrame, FSWaitForFrame2, FSWith

public abstract class FSActionObject
extends FSTransformObject

The FSActionObject is a base class for the classes that represent the different types of actions defined in the Flash file format specification. The function of the class is the same as the FSMovieObject class however the format of the encoded binary data is different. This class is primarily used internally in the library however the getType() method is useful when manipulating decoded Flash files. Rather than use run-time type inspection provided by the programming environment the method can be used to identify the action that a given object represents. The getType() method is essential when examining FSAction objects which represent a large number byte-codes which perform stack-based operations such as add, subtract, etc.


Field Summary
static int Call
           
static int ExceptionHandler
           
static int GetUrl
          Type identifying a GetUrl action.
static int GetUrl2
           
static int GotoFrame
          Type identifying a GotoFrame action.
static int GotoFrame2
           
static int GotoLabel
           
static int If
           
static int Jump
           
protected  int length
           
static int NewFunction
           
static int NewFunction2
           
static int Push
           
static int RegisterCopy
           
static int SetTarget
           
static int Table
           
protected  int type
           
static int WaitForFrame
           
static int WaitForFrame2
           
static int With
           
 
Constructor Summary
protected FSActionObject(FSActionObject obj)
           
protected FSActionObject(int aType)
           
 
Method Summary
 void decode(FSCoder coder)
           
 void encode(FSCoder coder)
           
 boolean equals(java.lang.Object anObject)
          Returns true if anObject is equal to this one.
 int getType()
          Gets the code used that identifies the type of the action when it is encoded.
 int length()
          Length is used to calculate the then of the action when it is encoded to the binary Flash file format.
 int length(FSCoder coder)
           
 
Methods inherited from class com.flagstone.transform.FSTransformObject
appendDescription, clone, name, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

GotoFrame

public static final int GotoFrame
Type identifying a GotoFrame action.

See Also:
Constant Field Values

GetUrl

public static final int GetUrl
Type identifying a GetUrl action.

See Also:
Constant Field Values

WaitForFrame

public static final int WaitForFrame
See Also:
Constant Field Values

SetTarget

public static final int SetTarget
See Also:
Constant Field Values

GotoLabel

public static final int GotoLabel
See Also:
Constant Field Values

WaitForFrame2

public static final int WaitForFrame2
See Also:
Constant Field Values

Push

public static final int Push
See Also:
Constant Field Values

Jump

public static final int Jump
See Also:
Constant Field Values

GetUrl2

public static final int GetUrl2
See Also:
Constant Field Values

If

public static final int If
See Also:
Constant Field Values

Call

public static final int Call
See Also:
Constant Field Values

GotoFrame2

public static final int GotoFrame2
See Also:
Constant Field Values

RegisterCopy

public static final int RegisterCopy
See Also:
Constant Field Values

Table

public static final int Table
See Also:
Constant Field Values

With

public static final int With
See Also:
Constant Field Values

NewFunction

public static final int NewFunction
See Also:
Constant Field Values

NewFunction2

public static final int NewFunction2
See Also:
Constant Field Values

ExceptionHandler

public static final int ExceptionHandler
See Also:
Constant Field Values

type

protected int type

length

protected int length
Constructor Detail

FSActionObject

protected FSActionObject(int aType)

FSActionObject

protected FSActionObject(FSActionObject obj)
Method Detail

getType

public int getType()
Gets the code used that identifies the type of the action when it is encoded.

Returns:
the code used to denote the type of action performed.

length

public int length()
Length is used to calculate the then of the action when it is encoded to the binary Flash file format. This method can be used to calculate the size of offsets and jumps for FSIf and FSJump actions.

Returns:
the length of the encoded action in bytes.

equals

public boolean equals(java.lang.Object anObject)
Returns true if anObject is equal to this one. Objects are considered equal if they would generate identical binary data when they are encoded to a Flash file.

Overrides:
equals in class FSTransformObject
Returns:
true if this object would be identical to anObject when encoded.

length

public int length(FSCoder coder)
Specified by:
length in class FSTransformObject

encode

public void encode(FSCoder coder)
Specified by:
encode in class FSTransformObject

decode

public void decode(FSCoder coder)
Specified by:
decode in class FSTransformObject