Solved

Pause or Stop then Resume on Click or Key Press

Posted on 2006-07-22
6
282 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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
The goal of the tutorial is to teach the user how to how to record live broadcast.

760 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now