com.flagstone.transform.sound
Class StartSound2

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

public final class StartSound2
extends Object
implements MovieTag

StartSound2 instructs the player to start or stop playing a sound. It extends the functionality of StartSound by specifying the Actionscript 3 class that is used to generate the sound.

See Also:
DefineSound, SoundInfo

Constructor Summary
StartSound2(SoundInfo aSound)
          Creates a StartSound object with an Sound object that identifies the sound and controls how it is played.
StartSound2(StartSound2 object)
          Creates and initialises a StartSound2 object using the values copied from another StartSound2 object.
StartSound2(SWFDecoder coder)
          Creates and initialises a StartSound2 object using values encoded in the Flash binary format.
 
Method Summary
 StartSound2 copy()
          Creates a complete copy of this object.
 void encode(SWFEncoder coder, Context context)
          Encode an object to the Flash binary format.
 SoundInfo getSound()
          Get the Sound object describing how the sound will be played.
 String getSoundClass()
          gets the name of Actionscript 3 class that contains the sound.
 int prepareToEncode(Context context)
          Prepare an object for encoding, returning the expected size of an object when it is encoded.
 void setSound(SoundInfo aSound)
          Sets the Sound object that describes how the sound will be played.
 void setSoundClass(String className)
          Set the name of the Actionscript 3 class that contains the sound.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StartSound2

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

StartSound2

public StartSound2(SoundInfo aSound)
Creates a StartSound object with an Sound object that identifies the sound and controls how it is played.

Parameters:
aSound - the Sound object. Must not be null.

StartSound2

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

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

getSoundClass

public String getSoundClass()
gets the name of Actionscript 3 class that contains the sound.

Returns:
the name of the Actionscript 3 class that provides the sound.

getSound

public SoundInfo getSound()
Get the Sound object describing how the sound will be played.

Returns:
the SoundInfo object that controls the playback.

setSoundClass

public void setSoundClass(String className)
Set the name of the Actionscript 3 class that contains the sound.

Parameters:
className - the name of the Actionscript 3 class that provides the sound.

setSound

public void setSound(SoundInfo aSound)
Sets the Sound object that describes how the sound will be played.

Parameters:
aSound - the Sound object that controls how the sound is played. Must not be null.

copy

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