|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.flagstone.transform.FSTransformObject
com.flagstone.transform.FSActionObject
com.flagstone.transform.FSPush
public class FSPush
FSPush is used to push values on the Flash Player's internal stack.
Attributes | |
---|---|
type | Identifies the action when it is encoded. Read-only. |
values | An array of values that will be pushed onto the Flash Player's Stack and used when executing actions. |
The FSPush action supports the full range of data types supported by Flash:
Data Type | Description |
---|---|
Boolean | A boolean value, 1 (true) or 0 (false). |
Integer | A signed 32-bit integer, range -2,147,483,648 to 2,147,483,647. |
Double | A double-precision (64-bit) floating-point number, range approximately +/- 1.79769313486231570E+308. |
String | A String. The string is encoded as using the UTF-8 encoding which is backward compatible with ASCII encoding supported in Flash 5. |
Register Index | The number (0,..3) of one of the Flash player's internal registers. |
Table Index | An index into a table of string literals defined using the FSTable action. |
Null | A null value. |
Void | A void value. |
Movie Clip Property | A reserved number used to identify a specific property of a movie clip. |
Player Property | A reserved number used to identify a specific property of the Flash Player. |
Movie Clip properties are used to access the attributes of the specified movie clip. To simplify using movie clip properties the values are defined as constants in the FSPush class:
Name | Description |
---|---|
_x | The x-coordinate of the current drawing point. |
_y | The y-coordinate of the current drawing point. |
_xscale | The scale of the player window in the x-axis. |
_yscale | The scale of the player window in the y-axis. |
_currentframe | The number of the frame currently being displayed |
_totalframes | The total number of frames in the current movie clip being played. |
_alpha | Whether the player supports alpha channel transparency in colours. |
_visible | Whether the player is currently visible. |
_width | The width of the player, in pixels, on the screen. |
_height | The height of the player, in pixels, on the screen. |
_rotation | The rotation of the movie clip in degrees |
_target | The current target or context for actions. |
_framesloaded | The number of frames from the movie clip that are currently loaded |
_name | The name of a movie clip. |
_droptarget | Then name of the movie clip currently being dragged. |
_url | The URL of the current movie clip being played. |
Player properties are used to access the attributes of the Player showing the movie clips. To simplify using player properties the values are defined as constants in the FSPush class:
Name | Description |
---|---|
_quality | Whether the player is set to display movie clips at high quality. |
_highquality | Whether the player is set to display movie clips at high quality. |
_focusrect | Whether a bounding yellow rectangle is drawn around the current object (a sprite or button) has the keyboard and mouse focus. |
_soundbuftime | The number of seconds to buffer streaming sound before playing |
_xmouse | The current x-coordinate of the mouse location. |
_ymouse | The current y-coordinate of the mouse location. |
The FSPush class maintains an array of values that will be pushed onto the stack. Any basic data types: boolean, int and double passed in the class constructors or using the add() methods are wrapped internally, in an Boolean, Integer and Double class respectively - simplifying how the class is used. Wrapper classes are only used explicitly when parsing a Flash files and manipulating the values stored in the array.
Push each of the different types value onto the stack:
FSPush boolean = new FSPush(true); FSPush integer = new FSPush(123); FSPush double = new FSPush(123.0); FSPush string = new FSPush("123"); FSPush null = new FSPush(new FSNull()); FSPush void = new FSPush(new FSVoid()); FSPush registerIndex = new FSPush(new FSRegisterIndex(0)); FSPush tableIndex = new FSPush(new FSTableIndex(0)); FSPush movieProperty = new FSPush(FSPush._x); FSPush playerProperty = new FSPush(FSPush._xmouse);
For efficiency a single FSPush action can push several values onto the stack in a single operation. The order in which values are added to the FSPush action is the same order in which the values are pushed onto the stack.
FSPush push = new FSPush(); push.add(123); push.add(123.0); push.add("123");
If an array of values are added to a FSPush object then boolean, int and double values must be wrapped using the Boolean, Integer and Double classes respectively.
FSPush is a class for representing the Push action of the Macromedia Flash (SWF) File Format Specification. It was introduced in Flash 4 and contained either an integer or string argument. It was extended in Flash 5 to support a number of different data types and allow more than one value to be added in a single action.
Field Summary | |
---|---|
static int |
_alpha
The transparency of the movie clip. |
static int |
_currentframe
The number of the current frame playing in the movie clip. |
static int |
_droptarget
The name of the movie clip currently being dragged |
static int |
_focusrect
Identifies whether a yellow rectangle is drawn around a button or test field that has the current focus. |
static int |
_framesloaded
The number of frames form the movie clip loaded. |
static int |
_height
The height of the movie clip in pixels. |
static int |
_highquality
Identifies the level of aliasing being performed by the Player. |
static int |
_name
The name of movie clip. |
static int |
_quality
Identifies the level of rendering quality being performed by the Player. |
static int |
_rotation
The angle of rotation of the movie clip in degrees. |
static int |
_soundbuftime
The amount of time streaming sound is buffered by the Player before playing. |
static int |
_target
The path of the movie clip relative to the root movie in the Player. |
static int |
_totalframes
The total number of frames in the movie clip. |
static int |
_url
The URL from which the movie clip was loaded. |
static int |
_visible
Whether the movie clip is visible. |
static int |
_width
The width of the movie clip in pixels. |
static int |
_x
The x-origin of the movie clip relative to the parent clip. |
static int |
_xmouse
The current x-coordinate of the mouse pointer on the Player screen. |
static int |
_xscale
The scaling factor of the movie clip in the x direction. |
static int |
_y
The y-origin of the movie clip relative to the parent clip. |
static int |
_ymouse
The current y-coordinate of the mouse pointer on the Player screen. |
static int |
_yscale
The scaling factor of the movie clip in the x direction. |
Fields inherited from class com.flagstone.transform.FSActionObject |
---|
Call, ExceptionHandler, GetUrl, GetUrl2, GotoFrame, GotoFrame2, GotoLabel, If, Jump, length, NewFunction, NewFunction2, Push, RegisterCopy, SetTarget, Table, type, WaitForFrame, WaitForFrame2, With |
Constructor Summary | |
---|---|
FSPush()
Constructs an FSPush action object with no values added. |
|
FSPush(java.util.ArrayList anArray)
Constructs an FSPush action that will push the values in the array onto the stack. |
|
FSPush(boolean aBoolean)
Constructs an FSPush action that will place the specified boolean value on the stack. |
|
FSPush(double aNumber)
Constructs an FSPush action that will place the specified double value on the stack. |
|
FSPush(FSCoder coder)
Construct an FSPush object, initialising it with values decoded from an encoded object. |
|
FSPush(FSNull nullValue)
Constructs an FSPush action that will place a null value on the stack. |
|
FSPush(FSPush obj)
Constructs an FSPush object by copying values from an existing object. |
|
FSPush(FSRegisterIndex anIndex)
Constructs an FSPush action that references one of the players internal registers. |
|
FSPush(FSTableIndex anIndex)
Constructs an FSPush action that reference a variable in a table. |
|
FSPush(FSVoid voidValue)
Constructs an FSPush action that will place a void value on the stack. |
|
FSPush(int aNumber)
Constructs an FSPush action that will place the specified integer on the stack. |
|
FSPush(java.lang.String aString)
Constructs an FSPush action that will place the specified value on the stack. |
Method Summary | |
---|---|
void |
add(boolean aBool)
Adds a boolean value to the array of values that will be pushed onto the stack. |
void |
add(double aDouble)
Adds a double value to the array of values that will be pushed onto the stack. |
void |
add(FSNull nullValue)
Adds a null value to the array of values that will be pushed onto the stack. |
void |
add(FSRegisterIndex anIndex)
Adds an FSRegisterIndex to the array of values that will be pushed onto the stack. |
void |
add(FSTableIndex anIndex)
Adds an FSTableIndex to the array of values that will be pushed onto the stack. |
void |
add(FSVoid voidValue)
Adds a void value to the array of values that will be pushed onto the stack. |
void |
add(int anInt)
Adds an integer value to the array of values that will be pushed onto the stack. |
void |
add(java.lang.String aString)
Adds a String to the array of values that will be pushed onto the stack. |
void |
appendDescription(java.lang.StringBuffer buffer,
int depth)
AppendDescription is used to present a string description of the object including all nested objects up to a specified depth. |
java.lang.Object |
clone()
Creates a deep copy of the entire object. |
void |
decode(FSCoder coder)
|
void |
encode(FSCoder coder)
|
boolean |
equals(java.lang.Object anObject)
Returns true if anObject is equal to this one. |
java.util.ArrayList |
getValues()
Gets the array of values. |
int |
length(FSCoder coder)
|
static java.lang.Integer |
propertyWithName(java.lang.String propertyName)
Translates the name of a property into the integer value used to identify the property by the Flash Player. |
void |
setValues(java.util.ArrayList anArray)
Sets the array of values. |
Methods inherited from class com.flagstone.transform.FSActionObject |
---|
getType, length |
Methods inherited from class com.flagstone.transform.FSTransformObject |
---|
name, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int _x
public static final int _y
public static final int _xscale
public static final int _yscale
public static final int _currentframe
public static final int _totalframes
public static final int _alpha
public static final int _visible
public static final int _width
public static final int _height
public static final int _rotation
public static final int _target
public static final int _framesloaded
public static final int _name
public static final int _droptarget
public static final int _url
public static final int _highquality
public static final int _focusrect
public static final int _soundbuftime
public static final int _quality
public static final int _xmouse
public static final int _ymouse
Constructor Detail |
---|
public FSPush(FSCoder coder)
coder
- an FSCoder containing the binary data.public FSPush()
public FSPush(boolean aBoolean)
aBoolean
- boolean value to push onto the stack.public FSPush(int aNumber)
aNumber
- integer value to push onto the stack.public FSPush(double aNumber)
aNumber
- double-precision floating-point value to push onto the stack.public FSPush(FSNull nullValue)
nullValue
- an instance of the simple FSNull class.public FSPush(FSVoid voidValue)
voidValue
- an instance of the simple FSVoid class.public FSPush(java.lang.String aString)
aString
- string literal value to push onto the stack.public FSPush(FSTableIndex anIndex)
anIndex
- an index into a literal table to push onto the stack.public FSPush(FSRegisterIndex anIndex)
anIndex
- a reference to one of the Flash Player's internal registers to
push onto the stack.public FSPush(java.util.ArrayList anArray)
anArray
- an array of values to be pushed onto the stack. The values in
the array must be one of the following classes: Boolean,
Integer, Double, String, FSRegisterIndex or FSTableIndex.public FSPush(FSPush obj)
obj
- an FSPush object.Method Detail |
---|
public static java.lang.Integer propertyWithName(java.lang.String propertyName)
propertyName
- a String representing the name of the property.
public void add(boolean aBool)
aBool
- a boolean value.public void add(int anInt)
anInt
- an integer (int) value.public void add(double aDouble)
aDouble
- a double-precision floating-point value.public void add(FSNull nullValue)
nullValue
- a lightweight FSNull object.public void add(FSVoid voidValue)
voidValue
- a lightweight FSVoid object.public void add(java.lang.String aString)
aString
- a String.public void add(FSTableIndex anIndex)
anIndex
- a FSTableIndex referencing an entry in a table of literals.public void add(FSRegisterIndex anIndex)
anIndex
- a FSRegisterIndex referencing one of the Flash Player's
internal registers.public java.util.ArrayList getValues()
public void setValues(java.util.ArrayList anArray)
anArray
- replaces the existing array of value with anArray. The values
in the array must be one of the following classes: Boolean,
Integer, Double, String, FSNull, FSVoid, FSRegisterIndex or
FSTableIndex.public java.lang.Object clone()
FSTransformObject
clone
in class FSTransformObject
public boolean equals(java.lang.Object anObject)
FSActionObject
equals
in class FSActionObject
public void appendDescription(java.lang.StringBuffer buffer, int depth)
FSTransformObject
appendDescription
in class FSTransformObject
buffer
- a StringBuffer to which the description of each object is
appended.depth
- the maximum level of nesting up to which objects will be
displayed.public int length(FSCoder coder)
length
in class FSActionObject
public void encode(FSCoder coder)
encode
in class FSActionObject
public void decode(FSCoder coder)
decode
in class FSActionObject
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |