Preventing double playing of a MovieClip

Posted on 2004-11-06
Last Modified: 2010-04-03

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.

Question by:dankazup
    1 Comment
    LVL 14

    Accepted Solution

    Hi dankazup,
           Perhaps this can help:


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
    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 set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
    This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

    779 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