all groups > flash actionscript > april 2004 >
You're in the

flash actionscript

group:

Music On/Off Button


Music On/Off Button briz_dad
4/21/2004 11:04:04 PM
flash actionscript:
Is there a action script around that has the following functionality?

Turn off music, browse to a different page, come back to original page and it
"remembers" that you chose no music.

I imagine you'd use a cookie for this but it is beyond my knowledge...

TIA,
Greg
Re: Music On/Off Button nITiNkIlLeRmEeRuT
4/22/2004 1:51:30 AM
To load a music
use
[b]music = new Sound("abc.mp3");[/b]
To play this sound use
[b]music.start(0,1);[/b]
To stop this sound
[b]music.stop();[/b]

For browsing if u r using html pages then u can use
[b]getURL("pagename.html");[/b]
For flash pages it depends on the way u r loading the pages.

For flash to remember u can use shared object. for using shared object search
in this site. or u can use cookies also but both are system(computer) specific.
Re: Music On/Off Button nITiNkIlLeRmEeRuT
4/22/2004 3:21:18 AM
I m so sorry about my last post. thanks urami_ for making it correct.

First you must initialize sound :

mySound = new Sound();
or
mySound = new Sound(this);

Than to actually get it to load you must import the sound in library , give it
ID name and
use the ID in attach action :

mySound.attachSound("IdNameHere");

or if loaded from outside :

mySound.loadSound("http://www.name.com/file.mp3", boolean);

where boolean value can be true or false
true for streaming sound and false for non streaming

Re: Music On/Off Button urami_
4/22/2004 10:06:37 AM


[quoted text, click to view]


that's pretty incorrect syntax.

there is no such thing as
music = new Sound("abc.mp3");

Please try to be more precise otherwise you only lead user into
wrong direction and he/she might go crazy trying to make it work and wonder why it
does not .

First you must initialize sound :

mySound = new Sound();
or
mySound = new Sound(this);

Than to actually get it to load you must import the sound in library , give it ID name and
use the ID in attach action :

mySound.attachSound("IdNameHere");

or if loaded from outside :

mySound.loadSound("http://www.name.com/file.mp3", false);



--

Regards


urami_*



<no>
http://flashfugitive.com/
</no>

AddThis Social Bookmark Button