Question
Making stop and play functions fool-proof
I have a timeline control embedded into my flash piece. It
contains the buttons "Re-Play, Pause, and Play." I am building some
testing software, therefore I have instances where the
animation/sound stops and waits for the user to select an answer.
At first, I had a problem that, when the user would come to a stop point, they could simply click the play button and the audio would continue (the play button simply held a command like this):
on (press) {
play();
}
So I changed it to an IF statement that looked for a variable before the PLAY button could be pressed. It looks like this:
MP3Player, Frame 1
set ("operator",1);
Play Button
on (press) {
if (operator==1) {
}
if (operator==2) {
play();
set ("operator",1);
}
}
Pause Button
on (press) {
stop();
set ("operator",2);
}
It shows that, in order for Play to work, the user must first PAUSE the flash piece.
The problem therein is that if the user comes to a stop in the timeline, they can simply click PAUSE and then PLAY and continue on the MP3Player element without advancing any of the animation. Is there anyone who can help me fix this? Thanks!
At first, I had a problem that, when the user would come to a stop point, they could simply click the play button and the audio would continue (the play button simply held a command like this):
on (press) {
play();
}
So I changed it to an IF statement that looked for a variable before the PLAY button could be pressed. It looks like this:
MP3Player, Frame 1
set ("operator",1);
Play Button
on (press) {
if (operator==1) {
}
if (operator==2) {
play();
set ("operator",1);
}
}
Pause Button
on (press) {
stop();
set ("operator",2);
}
It shows that, in order for Play to work, the user must first PAUSE the flash piece.
The problem therein is that if the user comes to a stop in the timeline, they can simply click PAUSE and then PLAY and continue on the MP3Player element without advancing any of the animation. Is there anyone who can help me fix this? Thanks!