View Full Version : Resetting Sound Object
SoccerCheese
04-04-2003, 04:21 PM
If I attach a sound to an object like this
mySound=new Sound();
mySound.attchSound("mySound01");
Can I reset mySound and attach "mySound02" somehow?
magicwand
04-04-2003, 06:09 PM
mySound=new Sound();
mySound.attchSound("mySound01");
Can I reset mySound and attach "mySound02" somehow?
Yes.
mySound.attchSound("mySound02");
and
mySound.start();
will give you new sound02.
CyanBlue
04-04-2003, 06:18 PM
mySound=new Sound(this); If I remember correctly, putting 'this' will make your life whole lot easier... If not, blame my memory... :D
magicwand
04-04-2003, 06:22 PM
mySound=new Sound(this);
explain that code for me?
how does "this" put new sound into mySound?
CyanBlue
04-04-2003, 06:31 PM
Well... Can't really explain it to you since I haven't used any sound object recently... :D
That 'this' being the target name, and you know that target nameis optional, right??? However, if you don't specify the target name, you get to see some weird things happening from time to time... Yet, putting 'this' gets rid of all that weirdos in your sound object... So, I said, just smack that in it...how does "this" put new sound into mySound?If you are asking how that one line can do the job of attchSound() and play(), it ain't gonna do it... That is just correction/suggestion for the first line that does initialization... ;)
magicwand
04-04-2003, 06:41 PM
target The movie clip instance on which the Sound object operates. This parameter is optional.
if i use the code inside the MC then this will be the mc ....sound object operates only in the mc....etc.etc???
oh well..i will put them and if it doesnt work i will del them :)
:D :D :D
CyanBlue
04-04-2003, 07:32 PM
Yeah... Try that and tell me if it is an angel or an evil...
SoccerCheese
04-04-2003, 07:52 PM
Thanks!
I wasn't sure if I had to detach the sound to help with playback or if just specifying a new identifier was enough.
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.