Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2517
  • Last Modified:

Flash script - layered pause/play button

I have a pause and play button.   It goes without saying that I need the pause to pause and the play to play.  I have that working now with the code included, but my problem is....  I'd like for the buttons to be layered and swap between pause/play.
//script on the instance btn_play
on (press) { 
play(); 
} 
 
//script on the instance btn_pause
on (press) { 
pause(); 
}

Open in new window

0
sl1nger
Asked:
sl1nger
  • 4
  • 3
1 Solution
 
quizengineCommented:
see the attached movie. Msg me if it doesn't make sense.
playpause-cs3.fla.jpg
0
 
sl1ngerAuthor Commented:
Do you know of a step by step tutorial for seomthing like  this?
0
 
quizengineCommented:
I don't (know of a tutorial) but if my sample works for you, are you not able to look at the structure of this and learn from it ?

I'm happy to answer any questions on it, and I think because I have specifically built something that matches your needs, you have a much better chance of learning by pulling this to bits.

Do you agree ? Do you have questions you want to ask ?

0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
sl1ngerAuthor Commented:
Yes.  Your example was good.  I'm trying to use this in conjunction with a pause and play button from the common library.
0
 
sl1ngerAuthor Commented:
Also, my movie starts and shows the pause button first because in my movie -- I'm making the ball roll from the start.  
0
 
quizengineCommented:
See new file with new behaviours. Check the stage for instructions on how to drop your buttons into the movie.
playpause-reversed-cs3.fla.jpg
0
 
sl1ngerAuthor Commented:
Thanks.  That makes sense now.  I found that it was breaking because I 'm using this every 24 frames --- stop();
var interval:Number = setInterval(
  function():Void {
    play();
    clearInterval(interval);
  },
  2000
);

Anyway, I can keep that.  Otherwise, I'll have to extend the frames to make pause longer.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now