PDA

View Full Version : simultaeneous streaming + volume control with a/script?


ryzkinno
07-23-2003, 06:12 PM
hey all,

Ive been reading over a few of the threads before posting, thinking that i might spare boring you all - but nothing quite answers my query.

Im building an online jukebox, offering a range of full tracks which the user can select between. I need to stream these to stop them interfering with the initial load up - so im going to load them as external swfs into empty movies on the main stage. No probs there.

The difficulty is that i need to be able to control the volume via a slider, and the only examples of volume control ive seen to date - involve the attach sound / linkage thingy! (done on a single frame with actions defining the sound etc)

however - ive just read on another tutorial - that streaming will only work on a timeline, with frames drawn out for as long as the track lasts. Im not sure if this is strictly correct.

Is there any way i can tell a track in the library to stream, then control the volume of that same track - all with actionscript?

Im sure its possible but im more than a little stumped guys.
Any help whould be greatly appreciated.


Ryz

fgf
07-24-2003, 06:32 AM
You can stream in mx using action script.

mySound.loadSound("url", isStreaming)

set isStreaming to true.

Use mySound.setVolume(volume) to adjust volume and just keep track of what sound object is currently playing in order to adjust the sound of the correct object.

fgf

ryzkinno
07-24-2003, 02:14 PM
Thanks fgf - unfortunately im only on Flash 5.

I wonder is there any way around this - perhaps controlling the computers master volume from flash?

I take it thats a no then!

(im joking............I think!)

jiggaracci
07-25-2003, 01:53 AM
Well first of all, I never thought the day would come when I could help someone with Flash 5/Actionscript. The reason I am so confident that I have your answer is because I am doing the samething that your are and I am using Flash 5/Actionscript, and I already have mine setup the way you want yours (streaming) with a verticle volume slide bar and play and stop and next and back buttons, all working properly. I can help you, but I'm such a noob, that I don't really know how I got it that way much less understand. But if you go to the tutorials section in here and check out their simple volume slider <--ScrAtch that! I just tried to find it, but it seems they took it off the site. But I know I got it from here. But anyway if you can get your sound to work using the attachsound method, it will also control the stream. I can do it with mine, but I'm having preloader issues. My music sounds choppy when steamed, however it is much faster. If you check my Topic in the general help forum, you will see a guy who's helping me. I'm sure he could help you.

subquark
07-25-2003, 10:28 AM
go to my site and look at my simple jukebox. the first sound is a loop, but the others are big streaming files. does my slider do what you need? when you set the volume and balance, it stays the same even when you select a new song

if that's it, some of my code is revealed with the little blue button and if that does not help you, let me know and I'll put the code up (at work now, no flash :( )

ryzkinno
07-25-2003, 11:42 AM
Cheers Guys,

Great to know there's people out there willing to help. Hope i can return the favour some time.

Checked out your site Subquark - amazing stuff, and the jukebox - is exactly what im after. Looked through the code and noticed you're loading into levels - which i havent a clue about. Do you think its possible to do it by loading external swfs into an empty movie on the stage, instead of using levels?
I guess i could do the level thing in the swf before i import it ?????? hmmmm

If you could post a little more on the coding (if its not too much hassle), ill take a read through and try to make sense of it.
Jiggaracci thanks for your help too - ill take a read thru your post in the forum.

thanks again guys

Ryz

subquark
07-25-2003, 02:22 PM
I'm not a fan of empty mcs (not sure how they work and causes me path problems). :confused:

If you don't get an answer from me this weekend, drop me an email, my subscriptions keep dropping off :( and I forget easily!

No trouble at all, look for an answer probably Saturday! :)

I use the same code for the jukebox at www.rockagainstsuicide.com