PDA

View Full Version : external swf sound issue


Lucidity
10-29-2007, 03:37 PM
I am having an issue. I have a container swf that loads an external swf into it, and plays it. Now, when I test the external swf on its' own, it works 100% fine. However, when I load it in the contained swf, it doesn't seem to play the sound. The sound attached and told to play on the first frame of a movieclip which is inside the external swf.

Here is the code I use to load the sound. I am not sure if it could be the cause, but who knows, right? Like I said, it is inside a movieclip, and the movieclip is on the main timeline.

var bg_sound:Sound = new Sound(); //makes sound variable
bg_sound.attachSound("introSound"); //attaches sound introSound
bg_sound.start(); //plays sound

any ideas what could be causing it?

Antonos
10-29-2007, 04:18 PM
Sound object doesn't know where to play sound, you have to set target movieClip, change your code

from
var bg_sound:Sound = new Sound(); //makes sound variable
to
var bg_sound:Sound = new Sound(this); //makes sound variable

Lucidity
10-29-2007, 04:23 PM
Looks like that did the trick. Thanks for the help!