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
          Type identifying a Call action.
static int ExceptionHandler
          Type identifying a ExceptionHandler action.
static int GetUrl
          Type identifying a GetUrl action.
static int GetUrl2
          Type identifying a GetUrl2 action.
static int GotoFrame
          Type identifying a GotoFrame action.
static int GotoFrame2
          Type identifying a GotoFrame2 action.
static int GotoLabel
          Type identifying a GotoLabel action.
static int If
          Type identifying an If action.
static int Jump
          Type identifying a Jump action.
protected  int length
           
static int NewFunction
          Type identifying a NewFunction action.
static int NewFunction2
          Type identifying a NewFunction2 action.
static int Push
          Type identifying a Push action.
static int RegisterCopy
          Type identifying a RegisterCopy action.
static int SetTarget
          Type identifying a SetTarget action.
static int Table
          Type identifying a Table action.
protected  int type
           
static int WaitForFrame
          Type identifying a WaitForFrame action.
static int WaitForFrame2
          Type identifying a WaitForFrame2 action.
static int With
          Type identifying a With action.
 
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
Type identifying a WaitForFrame action.

See Also:
Constant Field Values

SetTarget

public static final int SetTarget
Type identifying a SetTarget action.

See Also:
Constant Field Values

GotoLabel

public static final int GotoLabel
Type identifying a GotoLabel action.

See Also:
Constant Field Values

WaitForFrame2

public static final int WaitForFrame2
Type identifying a WaitForFrame2 action.

See Also:
Constant Field Values

Push

public static final int Push
Type identifying a Push action.

See Also:
Constant Field Values

Jump

public static final int Jump
Type identifying a Jump action.

See Also:
Constant Field Values

GetUrl2

public static final int GetUrl2
Type identifying a GetUrl2 action.

See Also:
Constant Field Values

If

public static final int If
Type identifying an If action.

See Also:
Constant Field Values

Call

public static final int Call
Type identifying a Call action.

See Also:
Constant Field Values

GotoFrame2

public static final int GotoFrame2
Type identifying a GotoFrame2 action.

See Also:
Constant Field Values

RegisterCopy

public static final int RegisterCopy
Type identifying a RegisterCopy action.

See Also:
Constant Field Values

Table

public static final int Table
Type identifying a Table action.

See Also:
Constant Field Values

With

public static final int With
Type identifying a With action.

See Also:
Constant Field Values

NewFunction

public static final int NewFunction
Type identifying a NewFunction action.

See Also:
Constant Field Values

NewFunction2

public static final int NewFunction2
Type identifying a NewFunction2 action.

See Also:
Constant Field Values

ExceptionHandler

public static final int ExceptionHandler
Type identifying a ExceptionHandler action.

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