|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
When you dynamically load a streaming sound via the sound object (mySound.load("url", true);) how do you determine how much of it needs to be loaded before it starts to play?
The manual says that flash needs to load enough of it to start the decompressor, but how much is that? Does it differ between systems or is it a constant amount of data? There's a "_soundbuftime" global that can be set, but how does that translate into bytes? Any ideas? |
|
#2
|
|||
|
|||
|
its usually a few seconds before it kicks in
with the _soundbuftime function, i wouldnt know about that. |
|
#3
|
|||
|
|||
|
Thanks for the response, but after futzing with it for a few hours, I've got it working the way I want to.
I was originally creating the sound object within a movie clip. I moved it out to the main timeline. After a couple tests, I determined that flash needs about 60% of the file before it starts to play. So I did this: Code:
bLoaded = _root.song.getBytesLoaded();
tSize = _root.song.getBytesTotal();
pLoaded = Math.round((bLoaded/tSize)*100);
// this gave me the percentage of the bytes loaded
// so I did this check to incorporate the 60% figure
if (pLoaded < 60) {
fixedP = Math.round((pLoaded/60)*100);
// 'message' is a dynamic text box
message.text = "Loading: " + fixedP + "%";
gotoAndPlay(2);
} else {
message.text = "Playing: " + songTitle;
}
It should be noted that if you want to stop and restart a streamed sound file, you'll need the latest version of the flash player. Having version 6 is not enough. Version 6.0.47.0 is what I got off the Macromedia site tonight, and it works like a champ. See the fruits of my labor: La Lumière Last edited by texdc : November 5th, 2002 at 01:32 AM. |
|
#4
|
|||
|
|||
|
|
![]() |
| Viewing: Dev Articles Community Forums > Web Design > Flash Development > sound object |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|