Solved

Pause or Stop then Resume on Click or Key Press

Posted on 2006-07-22
6
283 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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,…
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 select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

895 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

14 Experts available now in Live!

Get 1:1 Help Now