Why do my images suddenly scroll so much faster?

Posted on 2011-10-28
Last Modified: 2012-05-12
Head out to

Notice the pace of the rotating banner at the top of the page. Fine, right? Now, click on one of the buttons on the right hand side. The button is a simple command that advances the movie to a particular frame. Simple enough. But now watch the pace of the scrolling. It's now at least twice as fast and I don't know why.

I've got to fix it. How?

You can download the flash file and see my code etc by heading out to
Question by:brucegust
    LVL 39

    Accepted Solution

    you're calling a function which after 5 seconds must play and then you're clearing the interval. the problem is you should call the interval immediately, because say 3 seconds in you click a button, your interval is still running so after another 2 seconds it will progress.
    also declare the variable outside the function so it's within scope to clear it.
    var myInterval; 
    function wait(howLong)
    	 myInterval = setInterval(function ()
    	}, howLong);
    counter = 1;

    Open in new window


    Author Comment

    And that, blue-genie, is why you get paid the large dollar amounts!

    Thank you!

    Author Closing Comment

    Nailed it, as always!
    LVL 39

    Expert Comment

    LOL dude we don't get paid for this :-)
    but you're welcome.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
    Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
    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 what frame rate is, how to control it and what effect it has on the video.

    759 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

    8 Experts available now in Live!

    Get 1:1 Help Now