Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 231
  • Last Modified:

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 plays...how 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.

1 Solution
Hi dankazup,
       Perhaps this can help: http://www.gurusnetwork.com/tutorial/flash_sound_102/


Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now