Posted on 2006-04-05
Last Modified: 2008-02-01
setInterval(this, "reFresh",1000);
function reFresh():Void{

i have this code on the 30th frame of the movie, and i want it to go back to frame one every 1 second, but this code only works for the begining of the movie, after awhile it's all messed up, just wondering what is the proper way to implement it using AS, please help
Question by:koblongata
    LVL 17

    Expert Comment

    Is there any extra actions available between frame1 and frame30?
    And what is your frames per second(fps) rate. Because if your using it more than 30... then it will more than one second to go to 30th frame.. please explain more.

    BR Dushan
    LVL 17

    Expert Comment

    "Because if your using it more than 30... "
    should corrected as
    "Because if your using it less than 30... "

    BR Dushan
    LVL 39

    Accepted Solution

    hi, your problem is because you're not clearing your interval.
    what you need

    var bob = setInterval(this, "reFresh", 1000);
    function reFresh():Void {

    reason being, it goes to frame 30, calls the method, goes to frame 1, then keeps calling that method, so it never returns to frame 30 - it doesn't get a chance to.


    Author Comment

    thank ya

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    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. …
    There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
    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.
    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.

    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

    11 Experts available now in Live!

    Get 1:1 Help Now