03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

pan_txt.text = mix.getPan(this);<br />

You can use the following example to start the device sound. Because Flash Lite does not<br />

support streaming sound, it is a good practice to load the sound before playing it.<br />

var my_sound:Sound = new Sound();<br />

my_sound.onLoad = function(success) {<br />

if (success) {<br />

my_sound.start();<br />

} else {<br />

output.text = "loading failure";<br />

}<br />

};<br />

my_sound.loadSound("song1.mp3",false);<br />

See also<br />

setPan (Sound.setPan method)<br />

getTransform (Sound.getTransform method)<br />

public getTransform() : Object<br />

Returns the sound transform information for the specified Sound object set with the last<br />

Sound.setTransform() call.<br />

Note: Flash Lite 2.0 supports this method for native Flash sound only. The sound formats<br />

that are specific to a host device are not supported.<br />

Returns<br />

Object - An object with properties that contain the channel percentage values for the<br />

specified sound object.<br />

Example<br />

The following example attaches four movie clips from a symbol in the library (linkage<br />

identifier: knob_id) that are used as sliders (or knobs) to control the sound file that loads into<br />

the SWF file. These sliders control the transform object, or balance, of the sound file. For<br />

more information, see the entry for Sound.setTransform(). Add the following ActionScript<br />

to your FLA or AS file:<br />

var my_sound:Sound = new Sound();<br />

my_sound.loadSound("song1.mp3", true);<br />

var transform_obj:Object = my_sound.getTransform();<br />

this.createEmptyMovieClip("transform_mc", this.getNextHighestDepth());<br />

transform_mc.createTextField("transform_txt",<br />

transform_mc.getNextHighestDepth, 0, 8, 120, 22);<br />

transform_mc.transform_txt.html = true;<br />

570 ActionScript classes

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!