When using loadMovie to import one or more SWF files that contain sound, if this sound was set up in the loaded movie with ActionScript, you need to have the "this" keyword when declaring the sound object. See below and in the attached FLA files for the full code, but here is the line of code:
var mySound:Sound = new Sound(this); // "this" keyword is required
The loaded SWF file needed a mask, because until I added the mask, the off-stage content was appearing on the stage of the loader movie:
// A note to those who want to use this:
// If you want to use this, you'll need to update the file path to
// match your configuration. My html is one level higher than the
// SWF, hence the "movies/" in the path of the loadMovie command:
loadMovie("movies/as2_sound_this_in_target_path_loaded.swf", placeholder_mc);
// I assume you'll want to change it to this:
// loadMovie("as2_sound_this_in_target_path_loaded.swf", placeholder_mc);
// so that you can run everything from the same folder.
/* "this" keyword is required, since this SWF file gets loaded by another SWF
and Flash needs to know to obtain the sound file from THIS movie's library: */
var mySound:Sound = new Sound(this);
/* In the library, I gave the .wav file a 'Linkage Name' of "myGuitar", so that I could reference it in this ActionScript */
mySound.attachSound("myGuitar");
/* The first parm of "12.5" starts playing the clip at 12.5 seconds into it, since the clip starts with silence. The second parm says to loop it just once. Both parms are optional: */
mySound.start(12.5,1);
/* Move the text on horizontally from right to left.
Once the man has no text below him, make him fall: */
onEnterFrame = function() {
if (marqueeText_mc._x < -3000)
{ marqueeText_mc._x = 330; }
else
{ marqueeText_mc._x -= 3; }
if (marqueeText_mc._x < -2900)
{ walker_mc._y += 7; }
else
{ walker_mc._y = 116; }
} // end of onEnterFrame function