Solved

Pause or Stop then Resume on Click or Key Press

Posted on 2006-07-22
6
291 Views
Last Modified: 2008-02-01
I have a Flash (I'm using Flash Professional 8) file and basically what I want to do it pause or stop it (I can get it stopped using the stop(); command, but can't resume it...).  Then, have the file resume the next frame on a mouse click or by the press of a keyboard.

And, can I do this without buttons?  If not, any way would be helpful.  Thanks in advance!
0
Comment
Question by:CecilAdmin
  • 3
  • 3
6 Comments
 
LVL 23

Expert Comment

by:Zeffer
ID: 17161885
is this the main flash movie or a clip in the movie?

and yes you can do it without buttons.. how have you been trying to start it playing?

Z
0
 

Author Comment

by:CecilAdmin
ID: 17161892
This is the main flash movie.

I just had a stop(); on one frame and a play(); on another... I've tried goToAndStop();, but I can't really get it.  I'm not really a flash guru, so I am probably overlooking something obvious...
0
 
LVL 23

Expert Comment

by:Zeffer
ID: 17162277
make an empty movieclip.. go..insert/symbol.. name it empty clip

find it in the library.. drag it to a position off the side of the stage..

with it selected put the following code on it..

onClipEvent(keyDown){
    if(Key.getCode() == 32){ //space bar
    trace("stop");
     _parent.stop();
               }
}
onClipEvent(keyDown){
      if(Key.getCode() == 39){  //arrow right
            trace("go");
            _parent.play();
            }
}

Z
0
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:CecilAdmin
ID: 17164088
I've followed these steps...

When I hit spacebar is stops the animation, but the sound keeps playing.... is there a way to pause/stop everything?
0
 
LVL 23

Accepted Solution

by:
Zeffer earned 500 total points
ID: 17164386
nClipEvent(keyDown){
    if(Key.getCode() == 32){ //space bar
        _parent.stop();
        stopAllSounds();
               }
}
onClipEvent(keyDown){
     if(Key.getCode() == 39){  //arrow right
          _parent.play();
          }
}

Z
0
 

Author Comment

by:CecilAdmin
ID: 17164495
Thanks a lot for all of your help!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
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…
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

765 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