This content has been marked as final. Show 14 replies
are the songs being loaded dynamically or are they set on the timeline? If they are loaded dynamically, then you can use the Sound.stop() method to stop the streaming sound from playing. If they are set on the timeline, then you can put them into an empty movieclip and unload that empty movie clip when you want to stop the sound. That's the best advice I can give you right now without looking at your fla and seeing how you set everything up.
i believe you can stop the download by removing the movieclip that contains the sound object. instead of using this.unloadMovie() where this refers to your _level0 movie use:
p.s. don't test this in the flash test environment. upload the files and check your browser's cache to determine if the downloading has continued to completion.
"kglad" <firstname.lastname@example.org> wrote in message news:email@example.com...
> p.s. don't test this in the flash test environment. upload the files and check your browser's cache to determine if the
> downloading has continued to completion.
kglad.. streaming mp3s don't go into the cache. (at least not on my XP system)
Here's an idea,
Is there any way to dynamically load a streaming MP3 (that is an external MP3, not in the library) to a level other than level0?
In my testing of various solutions (which didn't work, but thanks for trying), it appears that FLASH streams into level0 no matter what, unless there is a code to over ride some default.
Here's what happened:
I tried creating an swf that streamed an MP3 when it starts (i.e. no buttons or anything.). It worked fine by itself, but of course, only closing the file would stop the streaming. I called this movie: sound.swf
I then created a loader movie, called PLAY.fla to bring the sound.swf into level1.
I made a START button at the root level of PLAY and configured it to perform a loadMovie("sound.swf",1) when pressed, which told Flash to bring the sound.swf into level 1 of the PLAY.fla. So now there are two movies on stage on different levels, PLAY (with it's buttons) in level0 and sound.swf in level1.
Then I created a STOP button and set it to perform and unloadMovie(1) on press. As I understand it, this would delete the sound.swf because it was in level1.
Then I tested the movie at the 56K simulation and watched the bandwidth profiler.
When I pressed the START button, the sound.swf got loaded, streamed the mp3 file and started playing it.
When I pressed the STOP button, the sound.swf movie was unloaded, but the bandwidth profiler indictated that the mp3 called by the sound.swf was still stremaing in.
So the only thing I can guess is that, no matter what level the streaming mp3 is in, it streams into level0, and only eliminating the level0 movie will get rid of the streaming. But that blows away the movie that holds the other movies, unless there is another way around it.
Any thoughts on this?
Gosh, why didn't Macromedia simply create a stopStreaming function for dynamically loaded MP3s?
tralfaz, check your cache now for that mp3 (if listened to it long enough for it to complete its download). the mp3 will start playing before it listed in your cache just like any partial download. when the download is completed it should be listed in your cache.
"kglad" <firstname.lastname@example.org> wrote in message news:email@example.com...
> tralfaz, check your cache now for that mp3 (if listened to it long enough for
> it to complete its download). the mp3 will start playing before it listed in
> your cache just like any partial download. when the download is completed it
> should be listed in your cache.
Yeah, your are right, as always. I have pulled many mp3s from my cache in the past but for some reason they weren't showing up in
my cache as expected in the last few months. I had thought it was the Flash 8 player doing it. Testing it again now they show up
just like they used to. I dunno. Never mind. hehehe
thanks for checking tralfaz. hopefully, the op will get back to this thread and find there's no need for a stopStreaming method.
"kglad" <firstname.lastname@example.org> wrote in message news:email@example.com...
> thanks for checking tralfaz. hopefully, the op will get back to this thread and find there's no need for a stopStreaming method.
I think he is looking at the bandwidth being used up by a downloading mp3 even after you are no longer interested in it. I have
looked at this problem once before. Seems that once you start the streaming, if you then decide to play a different song, the first
one keeps on downloading anyway, using up bandwidth and making the 2nd song unable to stream smoothly because half the bandwidth is
used up on the first song. It's no problem to stop playing it, but the dang streaming keeps going on in the background after you
don't want it anymore!
tralfaz, i understand the issue and i explained a solution: i believe you can stop the download.
you can't test the fix in the test environment but you can test online. to check if it works you'll fail to see the mp3 in your cache even after waiting long enough (after the streaming starts) for the mp3 to entirely download.
you can also test by trying on several (i believe greater than 5) streaming mp3s. i believe flash limits you to 5 simultaneous downloads. so, under normal circumstances you shouldn't be able to stream (even slowly) your 6th selection unless the previous streaming downloads have ceased.
"kglad" <firstname.lastname@example.org> wrote in message news:email@example.com...
> tralfaz, i understand the issue and i explained a solution: i believe you can
> stop the download.
> you can't test the fix in the test environment but you can test online. to
> check if it works you'll fail to see the mp3 in your cache even after waiting
> long enough (after the streaming starts) for the mp3 to entirely download.
> you can also test by trying on several (i believe greater than 5) streaming
> mp3s. i believe flash limits you to 5 simultaneous downloads. so, under
> normal circumstances you shouldn't be able to stream (even slowly) your 6th
> selection unless the previous streaming downloads have ceased.
OK.. gotcha. I will test it to see. Sometimes I get lazy about going back to the beginning of threads to get the whole picture.
First, I very much appreciate your help in tackling this problem. The support is great. Thank you ALL for your interest in this matter, and Boo on Macormedia for making it necessary! I still think they dropped the ball on this one. But you all seem to be on top of it. At least, enough of us are chasing it down!
I think kgal DID come up with a solution, once I got my coding right!
In my first test of kglad's solution, I had a code error that wasn't really a "true" AS error, so that gave me the wrong results.
I re-copied and pasted the code and then the "player" worked properly. (Sorry-- kicking myself)
Now that the AS was exaclty what kglad suggested, I saved the file as an SWF and HTML page and posted it along with a song to my Web site.
Okay so far.
Until, of course I remembered that I am on DSL (but I am trying to code for 56K users as well) so my song, at 321K just zipped in too fast for me to stop it getting into the cache.
Easy solution, I reconverted the song to a bigger size, 1.15 MB, which is still not enough to choke DSL, but it does slow it down enough that if I stop it, it won't cache.
Well, that worked!
Next, I alstered the code a little bit to add a start AND stop button, just to make sure of things.
It still seems to work, in that the song simply will NOT cache if, as kglad says, you hit the stop button before the song has a chance to comepletely download and then you wait long enough for it to have cached if it was going to.
(Why is this getting confusing?)
Okay, so I tested it in MSIE because I can use the Internet Tools to look at my cache files. Trying to do this with Firefox either eludes me or can't be done.
What I did in MSIE was opened the Internet Tools, clicked on the settings tab for cookies and cache and looked at the files. I saw my web page, my swf, and (if I allowed the song to play all the way) the song.
I cleared the cache, reloaded the page, started the download via the PLAY button. Then I stopped it after about a second. Then I waited the minute or so the song takes to play normally and checked the cache. It wasn't there! (hooray!)
So does this mean FLash actually did stop the streaming? It seems to indicate that to me and many thanks to kglad!
However, knowing i already messed up one attempt to use the code properly, or I may be analysing the situation incorrctly, would anyone care to try the same trick?
I hope this won't be considered spamming if I give you a Web link where the test page is:
I think this is the solution (though I am not sure whay testing it in the FLASH environment doesn't work-- kind of makes the test movie less than all it could be)
Thanks to everyone for your interest and support with this problem. I hope the tech folks at Macromedia see this thread and pick up on it so they can improve their product. Then again, they may raise the price! Oops.....
Thanks all, please, if you try my Web pager, post a reply here so I can see what you all found too.
And again, many thanks to kglad.
> So does this mean FLash actually did stop the streaming? It seems to indicate
> that to me and many thanks to kglad!
yes! I did some testing myself to be sure.. It works fine! Thanks kglad.
My test mp3 is huge.. 17 megs. I have to use giant files because my connection is too fast for a good test on a smaller one.
If you have a fast connection.. you can see here the percentage of the file that is downloaded. Interestingly enough, when you load
the streaming file again after stopping the download in the middle, it resumes where it left off.
I tried this..
create empty clip and load streaming sound per kglads suggestion..
mc1.s = new Sound();
Then after 10 megs have downloaded..
Check cache.. still empty. No 10 megs there.
Start up again with same code..
mc1.s = new Sound();
The downloaded bytes continues right where it left off at 10 megs.
Cache remains empty even after refresh until all 17 megs are downloaded.
Apparently, deleting the movieclip stops the streaming download but keeps the partial file in a temp file somewhere (but not in the
browser cache). When the same file is steamed again, it continues the download and copies it to the cache only after the entire
file is downloaded.
And that reminds me.. a long time ago there was a solution that someone came up with to download a file of the same name (from a
different folder), but this time a very short version. Doing that canceled out the download of the longer file. I think that's how