PDA

View Full Version : controlling objects (sounds) across movie clips



thumper
September 9th, 2003, 11:27 AM
Hi, I have a few movie clips running swf's and I need a play/stop button in one clip to control the audio in another clip.

Any ideas? The buttons are in the _root clip and the audio is contained in an swf I load into an empty 'content' movie. I have labelled the frame containing the audio but can't seem to use the object hierarchy to access it.

On a somewhat similar note, is there a way to have the root movie diplay the bytes loaded/bytes total of a swf loading over top of the root movie, ie in a content empty movie clip?

Thanks!

Voetsjoeba
September 9th, 2003, 11:41 AM
I don't know if you use Flash 5 or MX, but I'll explain MX here. On the main timeline:

ply = 1;
playpause.onRelease = function(){
if(ply){
ply=0;
_root.container.gotoAndPlay(2);
} else {
ply=1;
_root.container.stop();
}
}

Where container is the instance of a movieclip with the instance name container on the main timeline which the audio swf is loaded into. Play is a variable ot indicate playing or not. If playing, gotoAndPlay(2) (where 2 is the framenumber to start playing at), else stop.

To display the bytes loaded/bytes total of a movieclip that is dynamically loaded, simply use getBytesTotal() and getBytesLoaded() on the container of that movieclip :)