com.flagstone.transform
Class Remove

java.lang.Object
  extended by com.flagstone.transform.Remove
All Implemented Interfaces:
Copyable<MovieTag>, SWFEncodeable, MovieTag

public final class Remove
extends Object
implements MovieTag

RemoveObject 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 PlaceObject.

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 RemoveObject class is superseded in Flash 3 by the RemoveObject2 class which lifts this requirement allowing an object to be referenced by the layer number it occupies in the display list.

See Also:
Remove2, Place, Place2

Constructor Summary
Remove(int uid, int level)
          Creates a RemoveObject object that will remove an object with the specified identifier from the given layer in the display list.
Remove(Remove object)
          Creates and initialises a Remove object using the values copied from another Remove object.
Remove(SWFDecoder coder)
          Creates and initialises a Remove object using values encoded in the Flash binary format.
 
Method Summary
 Remove copy()
          Creates a complete copy of this object.
 void encode(SWFEncoder coder, Context context)
          Encode an object to the Flash binary format.
 int getIdentifier()
          Get the identifier of the object to be removed from the display list.
 int getLayer()
          Get the layer in the display list where the object will be displayed.
 int prepareToEncode(Context context)
          Prepare an object for encoding, returning the expected size of an object when it is encoded.
 void setIdentifier(int uid)
          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.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Remove

public Remove(SWFDecoder coder)
       throws IOException
Creates and initialises a Remove object using values encoded in the Flash binary format.

Parameters:
coder - an SWFDecoder object that contains the encoded Flash data.
Throws:
IOException - if an error occurs while decoding the data.

Remove

public Remove(int uid,
              int level)
Creates a RemoveObject object that will remove an object with the specified identifier from the given layer in the display list.

Parameters:
uid - the unique identifier for the object currently on the display list. Must be in the range 1.65535.
level - the layer in the display list where the object is being displayed. Must be in the range 1.65535.

Remove

public Remove(Remove object)
Creates and initialises a Remove object using the values copied from another Remove object.

Parameters:
object - a Remove object from which the values will be copied.
Method Detail

getIdentifier

public int getIdentifier()
Get the identifier of the object to be removed from the display list.

Returns:
the identifier if the object to be removed.

setIdentifier

public void setIdentifier(int uid)
Sets the identifier of the object to be removed.

Parameters:
uid - the unique identifier for the object currently on the display list. Must be in the range 1.65535.

getLayer

public int getLayer()
Get the layer in the display list where the object will be displayed.

Returns:
the layer number.

setLayer

public void setLayer(int aLayer)
Sets the layer in the display list where the object will be displayed.

Parameters:
aLayer - the layer in the display list where the object is being displayed. Must be in the range 1.65535.

copy

public Remove copy()
Creates a complete copy of this object.

Specified by:
copy in interface Copyable<MovieTag>
Returns:
a deep-copy of this object. New instances of mutable objects are copied and immutable instances are shared.

toString

public String toString()

Overrides:
toString in class Object

prepareToEncode

public int prepareToEncode(Context context)
Prepare an object for encoding, returning the expected size of an object when it is encoded. This method also used to initialise variables, such as offsets and flags that will be used when the object is encoded. Generally the method returns the size in bytes, however when called on objects that use bit fields such as shapes the methods will return the size in bits.

Specified by:
prepareToEncode in interface SWFEncodeable
Parameters:
context - an Context that allows information to be passed between objects to control how they are initialised for encoding.
Returns:
the size of the object when it is encoded.

encode

public void encode(SWFEncoder coder,
                   Context context)
            throws IOException
Encode an object to the Flash binary format.

Specified by:
encode in interface SWFEncodeable
Parameters:
coder - an SWFEncoder object.
context - an Context that allows information to be passed between objects to control how they are initialised for encoding.
Throws:
IOException - if an error occurs while encoding the object.


Copyright © 2002-2010 Flagstone Software Ltd.. All Rights Reserved.