com.flagstone.transform
Class MovieAttributes

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

public final class MovieAttributes
extends Object
implements MovieTag

The MovieAttributes tag defines characteristics of a Movie. It contains several flags to indicate types of objects in the movie and whether any hardware acceleration should be used if available. For Flash Version 8 and above it must be the first object after the MovieHeader.


Constructor Summary
MovieAttributes()
          Creates a new MovieAttributes object.
MovieAttributes(MovieAttributes object)
          Creates and initialises a MovieAttributes object using the values copied from another MovieAttributes object.
MovieAttributes(SWFDecoder coder)
          Creates and initialises a MovieAttributes object using values encoded in the Flash binary format.
 
Method Summary
 MovieAttributes copy()
          Creates a complete copy of this object.
 void encode(SWFEncoder coder, Context context)
          Encode an object to the Flash binary format.
 boolean hasAS3()
          Does the Movie contain meta-data.
 boolean hasMetaData()
          Does the Movie contain Actionscript 3 code.
 int prepareToEncode(Context context)
          Prepare an object for encoding, returning the expected size of an object when it is encoded.
 void setUseDirectBlit(boolean useBlit)
          Instruct the Flash Player to use direct bit block transfer to accelerate graphics.
 void setUseGPU(boolean useGPU)
          Instruct the Flash Player to use the graphics processor to accelerate compositing - if available.
 void setUseNetwork(boolean useNetwork)
          Instructor the Flash Player use the network for loading resources even if the movie is loaded from the local file system.
 String toString()
          
 boolean useDirectBlit()
          Does the Flash Player use direct bit block transfer to accelerate graphics.
 boolean useGPU()
          Does the Flash Player use the graphics processor to accelerate compositing - if available.
 boolean useNetwork()
          Does the Flash Player use the network for loading resources even if the movie is loaded from the local file system.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MovieAttributes

public MovieAttributes()
Creates a new MovieAttributes object.


MovieAttributes

public MovieAttributes(SWFDecoder coder)
                throws IOException
Creates and initialises a MovieAttributes 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.

MovieAttributes

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

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

hasMetaData

public boolean hasMetaData()
Does the Movie contain Actionscript 3 code.

Returns:
true if the movie contains at least one DoABC tag containing Actionscript 3 byte-codes.

hasAS3

public boolean hasAS3()
Does the Movie contain meta-data.

Returns:
true if the movie contains a MovieMetaData tag.

useDirectBlit

public boolean useDirectBlit()
Does the Flash Player use direct bit block transfer to accelerate graphics.

Returns:
true if the Flash Player will use direct bit block transfer.

setUseDirectBlit

public void setUseDirectBlit(boolean useBlit)
Instruct the Flash Player to use direct bit block transfer to accelerate graphics.

Parameters:
useBlit - use graphics hardware accelerations.

useGPU

public boolean useGPU()
Does the Flash Player use the graphics processor to accelerate compositing - if available.

Returns:
true if the Flash Player will use the graphics process for compositing.

setUseGPU

public void setUseGPU(boolean useGPU)
Instruct the Flash Player to use the graphics processor to accelerate compositing - if available.

Parameters:
useGPU - use graphics processor for compositing.

useNetwork

public boolean useNetwork()
Does the Flash Player use the network for loading resources even if the movie is loaded from the local file system.

Returns:
true if the network will be used even if the movie is loaded locally, false otherwise.

setUseNetwork

public void setUseNetwork(boolean useNetwork)
Instructor the Flash Player use the network for loading resources even if the movie is loaded from the local file system.

Parameters:
useNetwork - use the network even if the movie is loaded locally.

copy

public MovieAttributes 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.