Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 10-29-2009, 06:32 PM   #1
terraform
Member
 
Join Date: Oct 2007
Posts: 68
Default auto load SOUND with one button Pause/Resume issues.

**Sound SUPER newbie** + AS3 novice (I know some but am no coder)

I like what the script below does
but I need it to be extended in 2 ways and I can not figure how.

this is what I would like this code to do...
1. play (ideally stream) sound automatically on entering the site.
(right now the play button must be invoked, and it takes a little time to load.)
2. loop that same sound source
3. ideally instead of stopping the sound I would prefer a pause.

so more simply
sound plays on entering site
and I have ONE button (well 2 but changing visibilities)
that control only pause and resume

any thoughts suggestions pointers?

I have looked around quite a bit
but can never find what I am looking for
it would appear that everyones sound issues are so unique that no one
has the exact issue that I do (well I am sure many do but I can't find the thread. )

thanks in advance AS.org rocks (great community!)


oh and here is a link to what I have as of now

Code:
var loadSnd:URLRequest = new URLRequest("ax Mr .l..mp3");
var thisSnd:Sound = new Sound();
thisSnd.load(loadSnd);

play_btn.addEventListener(MouseEvent.CLICK,playF);
stop_btn.addEventListener(MouseEvent.CLICK,stopF);

var sndTrans:SoundChannel = new SoundChannel();
var st:SoundTransform = new SoundTransform();

stop_btn.visible = false;


function playF(e:MouseEvent):void
{
	SoundMixer.stopAll();
	st.volume = .9;
	sndTrans.soundTransform = st;
	sndTrans = thisSnd.play();
	play_btn.visible = false;
	stop_btn.visible = true;
}


function stopF(e:MouseEvent):void
{
	sndTrans.stop();
	play_btn.visible = true;
	stop_btn.visible = false;
}
terraform is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:58 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.