Copy link to clipboard
Copied
Hello!
I have a problem playing sound on mouse over event, sound attached from xml file.
The question is, can I attach two, or more different (excat) sound to the same movieclip?
F.E. I have a movieclip about the dog, and some button on the scene, "name", "sound", "etc".
If I click the button "name", and after I pointing the mouse over the dog_mc, the sound would be "a_dog.mp3", but if I click on the button "sound, the played mp3 would to change the "bark.mp3" on mouse over. Of course, there is lot of animals clip, so every clip have to have own sounds.
I am would to avoid attach the sound directly inside the movieclip, but not so familiar in XML, so if somebody can me explain it is possible, I would thank you.
Thanks
Copy link to clipboard
Copied
are you trying to load external mp3 files? if so, use a different sound instance for each different sound.
Copy link to clipboard
Copied
yes, I loaded lot of different external sound file. If I have make new instance for every sound it is can be few hundred instances, and it will grown in further as the animals be more on the scene...
The plan, if it possible, I have a variable, and that is changing dynamicly with something event targeg function depend on witch scene we are ("sound", "name") If I have to make different instances for each sound, then not necessaryà using xml, because I can load the sound file just as a sound variables, just the code will be few hundred lines...or may be I misunderstood something (I am not english mother language).
Copy link to clipboard
Copied
for each time you use:
soundinstance.load("yourmp3.mp3");
you need to use:
var soundinstance:Sound=new Sound();
soundinstance.load("yourmp3.mp3");
Copy link to clipboard
Copied
okay, got it, i shall try this...thank you. ![]()
Copy link to clipboard
Copied
you're welcome.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more