Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Is there a "pause()" movie clip method, or something equivalent?

Posted on 2006-11-03
3
Medium Priority
?
2,209 Views
Last Modified: 2008-10-19
I'd like to pause the _root time line for a second or so before jumping to another frame but I don't see any kind or a pause() or delay() function or movieclip method. Is there a way to do this.  

"Why would you want to do this?" I hear you ask.

I have a button that causes control to jump between two frames.  Each frame is full of ActionScript, complete with sounds that get started periodically.  The sounds generated in one frame seem to get started more frequently than they can complete, so a queue gets built up somewhere of sounds that have been started with a mySound.start()  but haven't actually played yet.   I say this because when I switch to the other frame I still hear about a second of sounds from the frame I'm leaving.  This is not good because the sounds don't sync up with the motion in the new frame. I've tried executing a mySound.stop() before leaving the current frame, but this just stops whatever sound is currently playing and doesn't prevent new sounds from being played. My thought was to stop all the timelines, so no more mySound.start()s get executed,  when the button issues the play() to get over the stop() in the current frame, and then execute somethihng like a pause(1) before leaving the frame code to let the queued up sounds play out.  

Or someone out there may have a much better idea.

Thanks for any suggestions.

Steve
0
Comment
Question by:steva
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 23

Accepted Solution

by:
Zeffer earned 2000 total points
ID: 17871569
Hi again..

you're on to the concept and to do it use setInterval to make a timer which counts the frame rate in milliseconds.

on the button..

on(press){
Interval = setInterval(timeChk, 3000); //that's about 3 seconds with frame rate of 12fps
_root.stop();

function timeChk() {
  clearInterval(Interval);
  _root.gotoAndPlay(2);
   }
}


Z
0
 

Author Comment

by:steva
ID: 17872528
Thanks
0
 

Expert Comment

by:ColinDiam
ID: 22969537
Use
onMouseDown=function(){
delay=setInterval(timeChk, 1000);
}

0

Featured Post

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
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…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
Suggested Courses

609 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