|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.flagstone.transform.action.RegisterCopy
public final class RegisterCopy
RegisterCopy is used to copy the item at the top of the stack to one of the Flash Player's internal registers.
The Flash Player uses a stack to store values when executing the actions associated with a button being pushed, frame being played, etc. If a value is used repeatedly in a calculation, it must be pushed onto the stack each time using an Push action. To speed up the execution of the calculation and reduce the amount of code required the value can be saved to one of the internal registers of the Flash Player using the RegisterCopy action. This copies the value currently at the top of the stack into the specified register. Pushing an RegisterIndex object onto the stack creates a reference to the register so the Flash Player uses the value directly rather than pushing the value onto the stack then immediately popping to use the value in a calculation.
The value is not removed from the stack. The number of registers supported was expanded in Flash 7 from 4 to 256.
RegisterIndex,
Push| Constructor Summary | |
|---|---|
RegisterCopy(int register)
Creates a RegisterCopy object with the register number. |
|
RegisterCopy(RegisterCopy object)
Creates and initialises a RegisterCopy action using the values copied from another RegisterCopy action. |
|
RegisterCopy(SWFDecoder coder)
Creates and initialises a RegisterCopy action using values encoded in the Flash binary format. |
|
| Method Summary | |
|---|---|
RegisterCopy |
copy()
Creates a complete copy of this object. |
void |
encode(SWFEncoder coder,
Context context)
Encode an object to the Flash binary format. |
int |
getNumber()
Returns the number of the Player register that the value on the stack will be copied to. |
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 |
|---|
public RegisterCopy(SWFDecoder coder)
throws IOException
coder - an SWFDecoder object that contains the encoded Flash data.
IOException - if an error occurs while decoding the data.public RegisterCopy(int register)
register - the number of one of the Flash Player's internal registers.
Must be in the range 0..255.public RegisterCopy(RegisterCopy object)
object - a RegisterCopy action from which the values will be
copied.| Method Detail |
|---|
public int getNumber()
public RegisterCopy copy()
copy in interface Copyable<Action>public String toString()
toString in class Objectpublic int prepareToEncode(Context context)
prepareToEncode in interface SWFEncodeablecontext - an Context that allows information to be passed between
objects to control how they are initialised for encoding.
public void encode(SWFEncoder coder,
Context context)
throws IOException
encode in interface SWFEncodeablecoder - an SWFEncoder object.context - an Context that allows information to be passed between
objects to control how they are initialised for encoding.
IOException - if an error occurs while encoding the object.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||