Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Am I doing this the best way?

Status
Not open for further replies.

manfishj

Programmer
May 30, 2002
44
US
Hi,
Can someone please tell me if I'm doing this the best way?

I have a slide presentation. Each slide is accompanied by a narration audio. Also, I have FF and REW controls to search through the sound.

So,on the main timeline, I have the slides, each which have been made into movie clips. Within each one of those movie clips, I have the narration audio sprite, extended all the way until the end of the audio. The sound is set to "stream". The FF button advances the movie clip's playhead 20 frames and REW brings it back 20 frames. This is the only way I could figure out how to search the audio.

Is this correct or is there a better way that I'm not aware of? Thanks in advance.

Oh, one other question..If this ends up being used for the web, how do the audio files need to be set up? Do they need to be externally or internally linked? I'm more used to using Director than Flash. Thanks.

manfishj

manfishj
 
There is a better way to do that. Here is how I do it.

I keep my controls in one MC. Each control is a button. On the ff button, I have code:

Code:
on(press){
	_global.ff = 1;
}
on(release){
	_global.ff = 0;
}

On the rewind button, use:

Code:
on(press){
	_global.rr = 1;
}
on(release){
	_global.rr = 0;
}

Then on the

Code:
onClipEvent(enterFrame){
	if(_global.rr == 1){
		if(_global.stopped == 0){
		_root.gotoAndPlay(_root._currentframe-5);
		}
		if(_global.stopped == 1){
		_root.gotoAndStop(_root._currentframe-5);
		}
	}
	if(_global.ff == 1){
		if(_global.stopped == 0){
		_root.gotoAndPlay(_root._currentframe+5);
		}
		if(_global.stopped == 1){
		_root.gotoAndStop(_root._currentframe+5);
		}
	}
}

I use _global.stopped with stop/play controls so if the clip is playing and the user searches ahead, it will either resume play or stay stopped.

As for your audio, you are correct having it set to Stream. Play around with different export settings to find the best quality/filesize for your use.

I hope that helps.
 
Sorry, I left an open-ended sentence up there:

Then on the MC containing the buttons... all that code.

I should learn to finish my
 
That's a lot of _globals. All you need to do is define it once then you can use the variable from anywhere within the movie...

at the start:

_global.ff;

then later:

ff=1;

etc...
 
Thanks, frozenpeas and wangbar!

This is a great help!
 
Hey frozenpeas....I tried your script and I can't get it to work. I did exactly what you said. I put the buttons in a movie clip and added the scripts as you said. The script seems to make sense to me, but it's not working. The only thing that was different on mine was---On the main timeline, each slide is set up as a movie clip. Each movie clip takes on the variable "myClip" as it plays. So, I added that into the "currentframe" part of the code like this:

root.gotoAndPlay(_root.myClip._currentframe-5);

When I click on the ff and rew buttons, nothing happens. Any ideas? thanks.

manfishj
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top