all groups > flash actionscript > january 2005 >
You're in the

flash actionscript

group:

Creating Sound Objects


Creating Sound Objects rsxu
1/31/2005 10:03:01 PM
flash actionscript:
Flash seems to have trouble targeting the sound objects that I have created. I
created a layer called "sound objects" and here's the code that I wrote in the
main timeline.

I've put the sound file in to an empty movie clip called "highdrum_mc" which
is inside another movie clip called "AllSounds". "AllSounds" contain 2 other
movie clips that contains sound files.

/*//create variable names for all audio tracks
highDrumTrack = new Sound(_root.AllSounds.highdrum_mc);
highDrumTrack.attachSound("highDrum01");
/*


I've put the sound file in to an empty movie clip called "highdrum_mc" which
is inside another movie clip called "AllSounds". "AllSounds" contain 2 other
movie clips that contains sound files.

but when i try to manipulate a specific track using the code below
/* _root.highDrumTrack.setVolume(position)*/
Flash cannot seem to locate the sound track.. how do i deal with that?
any help will be greatly appredciated. Thanks in Advance
Re: Creating Sound Objects NSurveyor
1/31/2005 10:22:05 PM
You're not using the Sound class correctly. First of all, when using new
Sound(target); target is the movie that contains the sound file you want to
attach but in it's library. You do not need to specify a target unless you are
loading another swf into the movie and want to use a sound from it's library.
Now, to use attachSound, you need to specify the linkage identifier of a sound
in your library.
Re: Creating Sound Objects rsxu
2/1/2005 3:28:22 PM
"the movie that contains the sound file you want to attach but in it's library"
Does that just mean putting a sound file on to the timeline of the movie clip?
That's what I tried to do. Also the "highDrum01" is the linkage ID. Sorry but
I'm new to flash, could you explain in a bit more detail, because i don't quite
understand what you mean.
AddThis Social Bookmark Button