Solved

Flash script - layered pause/play button

Posted on 2009-03-30
7
2,498 Views
Last Modified: 2013-11-11
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
Comment
Question by:sl1nger
  • 4
  • 3
7 Comments
 
LVL 19

Expert Comment

by:quizengine
ID: 24021265
see the attached movie. Msg me if it doesn't make sense.
playpause-cs3.fla.jpg
0
 

Author Comment

by:sl1nger
ID: 24021840
Do you know of a step by step tutorial for seomthing like  this?
0
 
LVL 19

Expert Comment

by:quizengine
ID: 24022973
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:sl1nger
ID: 24025361
Yes.  Your example was good.  I'm trying to use this in conjunction with a pause and play button from the common library.
0
 

Author Comment

by:sl1nger
ID: 24025406
Also, my movie starts and shows the pause button first because in my movie -- I'm making the ball roll from the start.  
0
 
LVL 19

Accepted Solution

by:
quizengine earned 500 total points
ID: 24027622
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
 

Author Comment

by:sl1nger
ID: 24043524
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question