I am currently building a multimedia app and have run into a couple of problems.
1) There is one "holder" movie that loads in others, ranging from flv's to mp3's and also
swf's. I need to have a "global" mute button - ie one that will just mute the volume of the master movie and everything playing inside it. Can this be done without targetting the specific elements? Like something along the lines of
- Code: Select all
on (release){
_root.setVolume(0);
}
2) One of the
swf movies loaded in this app is an mp3 player. The animation loads up in frames 1-10, and then there are 20 mp3's on frames 11-21, loaded in using mediaDisplay. It needs to play random tracks, so on frame 10 I have thid code:
- Code: Select all
function randRange(min, max) {
var randomNum = Math.round(Math.random()*(max-min))+min;
return randomNum;
}
var say;
say = randRange(11, 21);
gotoAndStop(say);
Which works absolutely fine, however I cannot figure out a way of playing other random tracks after that one has finished. I was thinking I'd either have to use cue points which would be fiddly, or possibly add some code to my progress bar so that when it reaches the end of a track, the playhead goes back to frame 10 to choose another random frame. Here's my progress bar code:
- Code: Select all
var listenerObject:Object = new Object ();
listenerObject.change = function (eventObj:Object) {
var percentPosition = (rock1_mc.playheadTime / rock1_mc.totalTime);
var frame = Math.round (percentPosition * 999) + 1;
rock1_slider_mc.gotoAndStop (frame);
};
rock1_mc.addEventListener ("change",listenerObject);
stop();
Above, rock1_mc is the mediaDisplay instance, and rock1_slider_mc is the progress bar.
Any help on this would be very much appreciated.