all groups > flash actionscript > may 2005 >
You're in the

flash actionscript

group:

Flash radio


Flash radio bonj100
5/29/2005 8:46:40 PM
flash actionscript:
I can't seem to get right is the scripting on my buttons for my flash radio. I
want the clips to play only when the play button is selected and I have buttons
to move forward from clip to clip and of course a stop button. If the visitor
hits play, unless they hit stop or choose the next and previous buttons, the
player should simply move forward from clip to clip. If they hit stop or fail
to hit play, it should do nothing.

Could someone please help me with the scripting on the play button? I just
don't seem to be getting it quite right.
Re: Flash radio kglad
5/29/2005 9:38:17 PM
we're going to need some hints about your movie's set-up. are these movieclips
or sound clips? are the already instantiated or do they need to be loaded or
attached? do these clips have instance names?
Re: Flash radio bonj100
5/29/2005 9:45:22 PM
They already have instance names, they are sound clips only about a minute long
each, although I may do some full length songs later. I have gotten partial
success with some information I dug up but it didn't quite make it so the song
doesn't play unless the play button is pressed. That's the part I'm having the
most trouble with. Either it won't play the song at all or it will restart the
song but I can't keep it from playing on it's own.
Re: Flash radio kglad
5/29/2005 9:57:44 PM
i assume you're using the sound class. to start your clips after they are attached or loading is complete use:

Re: Flash radio bonj100
5/29/2005 10:02:35 PM
Re: Flash radio kglad
5/29/2005 10:24:07 PM
so, have you put those instance names into an array so you can easily play one
sound instance after another? if not, do so. for example:

soundA=[sound0, sound1,... ]; /* assuming these are already instantiated.
otherwise, store string values that you'll instruct flash to interpret as
objects using bracket notation, after they're instantiated. */

you can then use a function like the following:

function playF(ivar){
soundA[ivar].onSoundComplete=function(){
ivar++;
soundA[ivar].start();
playF(ivar);
}
}

when you want to start this sequence of plays just call playF(0).

AddThis Social Bookmark Button