Preventing double playing of a MovieClip


I have a simple timeline setup:

3 layers
Layer 1 - Actions
Layer 2 - An instance of a button that takes up the entire stage
Layer 3 - An instance of a Movie Clip

The movie Clip instance contains only audio.

The situation is I would like to simulate a Voice Response system in which the user clicks on the button (a graphic of a phone) and hears the correct voice response prompt (this is the audio contained in the movie clip instance)

My timeline is 10 frames long with a stop(); action in frame 1

The following code is attached to the button:

Frame 5 contains a keyframe on the movieclip layer and I have placed an instance of the movieclip on te stage at that frame.

This works ok, when I click the button the audio plays...the problem is....everytime I press the button a new instance of the audio can I check to see if an instance of the audio is playing and do one of two things on a button click:

1. If no audio playing on button click  - play audio (movieclip)
2. If audio is playing(movieclip) - restart the audio movieclip.

I appreciate any help on this.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Hi dankazup,
       Perhaps this can help:


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Flash

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.