Solved

Pause or Stop then Resume on Click or Key Press

Posted on 2006-07-22
6
292 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
[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
  • 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
Industry Leaders: 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: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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Suggested Solutions

Title # Comments Views Activity
How to disable  HTML5 video in chrome 2 1,579
Action Script coding 1 186
How do i create a Class that can control the main stage in action script 1 44
File drag and drop 6 152
Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
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.

740 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