December 22, 2006 Exported audio won’t load from a loaded movie in Flash 8.

Today, I was working on a flash website for a client when I ran into an interesting problem: My Action-Scripted sounds weren't playing from a internally loaded swf.

The setup was simple:
Using Flash 8, I made a main movie that loads the interface, and when another section is clicked it loads within the main swf. I was also using the same script that I usually do for sound, which always seems to work (and is subsequently the one Adobe/Macromedia recommends).

Like so:

  1. function buttonSound() {
  2. blip = new Sound();
  3. blip.attachSound("blipHover");
  4. blip.setVolume(100);
  5. blip.start();
  6. }

My script was right, and my linkage was right:

image

It was a total mystery to me, so as usuall, I chose not to google the problem, and I experimented. Oddly on the first try I discovered that if you are calling an exported sound in a swf loaded withen a swf, the sound needs to be exported in the main swf and not the loaded swf.

Weird stuff.

AddThis Social Bookmark Button Posted by Greg Ferrell at 09:48 PM. Filed under: Flash-ActionScript • (2) CommentsPermalink