Controling sound of an external SWF

Hi All,

I’m making an application and I can’t seem to find a way to control my sound of an external SWF(SWF2) from the main one(SWF1).

Here is the code I’m using to control the timeline of external SWF that is placed inside of the main movie


var loadAnimBox:Loader = new Loader();
var vid_mc:MovieClip;

function startLoading():void {
    loadAnimBox.contentLoaderInfo.addEventListener(Event.COMPLETE, onBoxLoaded);
    // load the box animation SWF
    loadAnimBox.load(new URLRequest((meuCaminho.parameters.var3) + ".swf"));
}

function onBoxLoaded(e:Event):void {
    loadAnimBox.contentLoaderInfo.removeEventListener(Event.COMPLETE, onBoxLoaded);

    vid_mc = loadAnimBox.content as MovieClip;
    // We listen for that event:
    vid_mc.addEventListener("firstAnimationComplete", onFirstComplete, false, 0, true);    
    addChild(vid_mc);
    
    // set up the play button 
    play_btn.addEventListener(MouseEvent.CLICK, playClick);    
    stop_btn.addEventListener(MouseEvent.CLICK, stopClick);

}

function onFirstComplete(e:Event):void {
    // we should remove the listener if we're not going to play this again
    trace("First animationn complete, start second animation.");
}

function playClick(e:MouseEvent):void {
    vid_mc.play();
}
function stopClick(e:MouseEvent):void {
    vid_mc.stop();
}

now here is the code i’m using to make the import the sound on the external SWF


import flash.media.Sound;
import flash.net.URLRequest;
import flash.display.Sprite;
import flash.media.SoundChannel;
import flash.events.Event;
import flash.events.MouseEvent;

var _som1:Sound;
var _channel1:SoundChannel;
var _playing1:Boolean = false;
var _position1:int;

_som1 = new Sound( new URLRequest ( "som1.mp3"));
_channel1 = _som1.play(0,1); // first number = 0 sec sound start 1000 = 1 sec second number is how many times the sound will play


/*_play.addEventListener(MouseEvent.CLICK, playSound);
_pause.addEventListener(MouseEvent.CLICK, pauseSound);

function playSound(event:MouseEvent):void {
    _channel1 = _som1.play(_position1);
}

function pauseSound(event:MouseEvent):void {
    _position1 = _channel1.position;
    _channel1.stop();
}
*/

The control buttons all work inside the movie the sound is but when I place it on the main movie it all goes down…

Can anyone please help?

Thanks a lot