Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

sound from xml

New Here ,
Nov 03, 2009 Nov 03, 2009

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

TOPICS
ActionScript
630
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 03, 2009 Nov 03, 2009

are you trying to load external mp3 files?  if so, use a different sound instance for each different sound.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 03, 2009 Nov 03, 2009

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).

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 03, 2009 Nov 03, 2009

for each time you use:

soundinstance.load("yourmp3.mp3");

you need to use:

var soundinstance:Sound=new Sound();

soundinstance.load("yourmp3.mp3");

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 03, 2009 Nov 03, 2009

okay, got it, i shall try this...thank you.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 03, 2009 Nov 03, 2009
LATEST

you're welcome.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines