Solved

Flash clearInterval Function Not Working??

Posted on 2004-09-17
2
533 Views
Last Modified: 2012-06-21
Hello,

I am trying to hide an image based on a rollover function.  Once rollover occurs, the setInterval function is set to time out at 4 seconds and display a movie clip.  This works great except after awhile Flash gets confused when rollover buttons many times.  Flash displays the mc too quickly if buttons are rolled over multiple times.  Any other ideas are appreciated.

Thank you,

Terry

Sample FLA:

http://www.myhealthtv.com/hideTest.fla
0
Comment
Question by:splendorx
[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
2 Comments
 
LVL 10

Accepted Solution

by:
muso120999 earned 250 total points
ID: 12085669
add clearInterval to your rollOver, before setInterval:

for (i=0; i<6; i++) {
      this["broadcastImage"+i+"_btn"].onRollOver = function() {
            //REMOVE SPLASH IMAGE
            clearInterval(timerInterval);
            _root.splashImage_mc._visible = false;
            timerInterval = setInterval(timesUp, 4000);
      };
}

It is probably better practice to check if timerInterval is undefined before clearing, but it does work, and without any errors.
0
 
LVL 1

Author Comment

by:splendorx
ID: 12086085
Thank you Muso!!! Works as expected!  
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
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.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

631 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