PDA

View Full Version : pause and resume slide presentation


zoeH
04-18-2006, 12:55 PM
Hi, i am creating a elearning presentation using the slide presentation in flash mx prof. I have a streaming mp3 file on the "presentation" slide which i bring in by using the media display component. The streaming mp3 has cue points which trigger the slides. On each slide there is a series of animation.

The problem i have is that i need to add a pause and resume button to the presentation. i have tried adding buttons to the "presentation" slide but stop() doesnt work and stopAllSounds only stops the sound (if it is on a slide where animation is taking place it doesnt stop the animation). I have tried loading the movie into a new movieclip in a new file and adding the buttons there but the stop button does not work at all (and other script i have tried doesnt work either). What i need is the presentation (including sound) to pause and then resume at the place that it stopped .

I have looked around and tried various code for a few days now but cant quite find anything that is what i need. Is the problem the fact that i have used the slide presentation format instead of scenes? or that the streaming sound is controlling the slides?

Apologies for my ignorance, im pretty new to all of this - urgent help would be appreciated before my boss sacks me for wasting company time! Many thanks

mikhaii
04-18-2006, 01:34 PM
my friend.. this is me.. i consider my self a noob since flash still cripples my mind..but here is my attempt to save you my friend!

okay! Load the sound.. pick a main frame.. probably first frame in your movie.. your loading your sound..

keep it global for easy communication between files

_global.timelineSound = new Sound();
//load a sound into timlineSound
global.timelineSound.loadSound("SONG.mp3", true);

now this.. this function should be able to pause the song..(should work) worked for me..

i would put this or call this function on your "pause" or "stop " button

function stopTimelineSound() {
_global.timelineSound.stop();
_global.pausedPoint = _global.timelineSound.position/1000;
_level0.music.stop();

}

//call the function
stopTimelineSound();


// start it back up.. put this on the play button or something..

_global.timelineSound.start(_global.pausedPoint);

this should pause a streaming sound ..thats not embedded ....

now stopping the timeline.. say your loading your slides into a movieclip called box_mc

say something like box_mc.stop(); or box_mc.play() it will whatever is loaded.. and if you want to keep track or frame labels inside

try this.. box_mc._currentframe==2 ... make it an if statement or whatever..

good luck

zoeH
04-18-2006, 02:11 PM
Hey thanx for trying to save me. Im not sure if my explanation was that clear before. The sound file has cue points which trigger the slides. When the pause button is pressed it therefore needs to pause the sound and the animation on the slide. And then the play needs to resume all.

I tried your code and the pause worked but couldnt get the play to work?

thanx again for your time

zoeH
04-18-2006, 07:52 PM
can anyone else please help?

just to recap - i have a streaming sound with cue points that trigger slides. I need a pause and play button to pause all then resume all again.

Thanks very much