MaTT,
You wouldn't 'move' the reference to the sounds but you can get at them in
order to control them.
You could use a for...in loop to access the sound objects.
<code (in parent swf)>
var sndRefArr:Array = Array();
function sndInTarget(mc:MovieClip){
//where mc is the child swf
var tmpSndArr:Array = Array();
for(var i in mc){
if(typeof(mc[i]) == "object"){
//test whether or not this is a sound object
if(mc[i].getVolume() != undefined){
trace("Sound object: i = "+i);//sound object's name
trace("Sound object: mc[i] = "+mc[i]);//[object Object]
//set all these sounds to 50% volume e.g.
mc[i].setVolume(50);
//capture a reference to the current sound object
tmpSndArr.push(i);
}
}
}
//store refs for later use
sndRefArr.push([mc,tmpSndArr]);
}
//one way to use the stored refs array
function muteSnds(mc:MovieClip, arr:Array){
var limit:Number = arr.length;
for(var i = 0; i < limit; i++){
var o:Object = arr[i];
mc[o].setVolume(0);
}
}
//call function to populate stored refs array
sndInTarget(myLoadedSWF);
muteBtn.onRelease = function(){
//get some use out of the stored refs array
//not perfect, just going for proof-of-concept here
var refMC:MovieClip = sndRefArr[0][0];
var tmpArr:Array = sndRefArr[0][1];
muteSnds(refMC, tmpArr);
}
</code (in parent swf)>
I would be interested to know just what sort of app you are working on.
HTH,
-Keith
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Matt Muller
Sent: Tuesday, January 31, 2006 11:46 AM
To: Flashcoders mailing list
Subject: [Flashcoders] changing reference of sounds to _parent clip
if I had some sounds loaded in a swf, but i wanted to move their reference
from the swf to the parent, is that possible?
cheers
MaTT
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders