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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

See also<br />

maxscroll (TextField.maxscroll property), scroll (TextField.scroll property)<br />

_soundbuftime property<br />

_soundbuftime:Number = integer<br />

Establishes the number of seconds of streaming sound to buffer. The default value is 5<br />

seconds.<br />

Parameters<br />

integer:Number - The number of seconds before the SWF file starts to stream.<br />

Example<br />

The following example streams an MP3 file <strong>and</strong> buffers the sound before it plays for the user.<br />

Two text fields are created at runtime to hold a timer <strong>and</strong> debugging information. The<br />

_soundbuftime property is set to buffer the MP3 for 10 seconds. A new Sound object<br />

instance is created for the MP3.<br />

// create text fields to hold debug information.<br />

this.createTextField("counter_txt", this.getNextHighestDepth(), 0, 0, 100,<br />

22);<br />

this.createTextField("debug_txt", this.getNextHighestDepth(), 0, 20, 100,<br />

22);<br />

// set the sound buffer to 10 seconds.<br />

_soundbuftime = 10;<br />

// create the new sound object instance.<br />

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

// load the MP3 sound file <strong>and</strong> set streaming to true.<br />

bg_sound.loadSound("yourSound.mp3", true);<br />

// function is triggered when the song finishes loading.<br />

bg_sound.onLoad = function() {<br />

debug_txt.text = "sound loaded";<br />

};<br />

debug_txt.text = "sound init";<br />

function updateCounter() {<br />

counter_txt.text++;<br />

}<br />

counter_txt.text = 0;<br />

setInterval(updateCounter, 1000);<br />

this property<br />

this<br />

Global Properties 103

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

Saved successfully!

Ooh no, something went wrong!