Solved

Flash script - layered pause/play button

Posted on 2009-03-30
7
2,505 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…

628 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