|
|||||||||
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.FSMovieObject
com.flagstone.transform.FSRemoveObject
public class FSRemoveObject
FSRemoveObject removes an object from the Flash Player's Display List.
An object placed on the display list is displayed in every frame of a movie until it is explicitly removed. Objects must also be removed if its location or appearance is changed using either the FSPlaceObject or FSPlaceObject2 classes.
Attributes | |
---|---|
type | Identifies the data structure when it is encoded. Read-only. |
identifier | The unique identifier, in the range 1..65535, of the object. |
layer | The layer at which the object is placed in the Display List. |
Although only one object can be placed on any layer in the display list both the object's unique identifier and the layer number must be specified. The FSRemoveObject class is superseded in Flash 3 by the FSRemoveObject2 class which lifts this requirement allowing an object to be referenced by the layer number it occupies in the display list.
1. Remove an object.
To remove an object from the display list the
object's identifier and the layer number using when the object was placed is
used.
// Place a shape to the display list for one frame. movie.add(new FSPlaceObject(shape.getIdentifier(), 1, 400, 400)); movie.add(new FSShowFrame()); // now remove it. movie.add(new FSRemoveObject(shape.getIdentifier(), 1)); movie.add(new FSShowFrame());
2. Move an object.
To move an object it first must be removed from the
display list and repositioned at its new location. Adding the object, with a
new location, on the same layer, although only one object can be displayed on
a given layer, will not work. The object will be displayed twice.
// Add the shape to the display list. movie.add(new FSPlaceObject(shape.getIdentifier(), 1, 400, 400)); movie.add(new FSShowFrame()); // Move shape to a new location, removing the original so it does not get displayed twice. movie.add(new FSRemoveObject(shape.getIdentifier(), 1)); movie.add(new FSPlaceObject(shape.getIdentifier(), 1, 250, 300)); movie.add(new FSShowFrame());
The FSRemoveObject class represents the RemoveObject tag from the Macromedia Flash (SWF) File Format Specification. It was introduced in Flash 1 and is superseded by the RemoveObject2 tag which was added in Flash 3.
Field Summary |
---|
Constructor Summary | |
---|---|
FSRemoveObject(FSCoder coder)
Construct an FSRemoveObject object, initialising it with values decoded from an encoded object. |
|
FSRemoveObject(FSRemoveObject obj)
Constructs an FSRemoveObject object by copying values from an existing object. |
|
FSRemoveObject(int anIdentifier,
int layer)
Constructs an FSRemoveObject object that will remove an object with the specified identifier from the given layer in the display list. |
Method Summary | |
---|---|
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. |
void |
decode(FSCoder coder)
|
void |
encode(FSCoder coder)
|
boolean |
equals(java.lang.Object anObject)
Returns true if anObject is equal to this one. |
int |
getIdentifier()
Gets the identifier of the object to be removed from the display list. |
int |
getLayer()
Gets the layer in the display list where the object will be displayed. |
int |
length(FSCoder coder)
|
void |
setIdentifier(int anIdentifier)
Sets the identifier of the object to be removed. |
void |
setLayer(int aLayer)
Sets the layer in the display list where the object will be displayed. |
Methods inherited from class com.flagstone.transform.FSMovieObject |
---|
getType |
Methods inherited from class com.flagstone.transform.FSTransformObject |
---|
clone, name, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public FSRemoveObject(FSCoder coder)
coder
- an FSCoder containing the binary data.public FSRemoveObject(int anIdentifier, int layer)
anIdentifier
- the unique identifier for the object currently on the display
list.layer
- the layer in the display list where the object is being
displayed.public FSRemoveObject(FSRemoveObject obj)
obj
- an FSRemoveObject object.Method Detail |
---|
public int getIdentifier()
public int getLayer()
public void setIdentifier(int anIdentifier)
anIdentifier
- the unique identifier for the object currently on the display
list.public void setLayer(int aLayer)
aLayer
- the layer in the display list where the object is being
displayed.public boolean equals(java.lang.Object anObject)
FSMovieObject
equals
in class FSMovieObject
public void appendDescription(java.lang.StringBuffer buffer, int depth)
FSTransformObject
appendDescription
in class FSMovieObject
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 FSMovieObject
public void encode(FSCoder coder)
encode
in class FSMovieObject
public void decode(FSCoder coder)
decode
in class FSMovieObject
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |