Announcement Announcement Module
Collapse
No announcement yet.
Question about setInterval in Flash 8 Page Title Module
Move Remove Collapse
Search Search Module
Collapse

Advertisement Advertisement Module
Collapse

Featured Images Featured Images Module
Collapse

Mediabistro Creative Sites Mediabistro Creative Sites Module
Collapse
Latest Topics Latest Topics Module
Collapse

  • PrintDriver
    Reply to The legalities of "Fan Art" and Copyrights/Trademarks
    PrintDriver
    I need to find an hour to watch that video. Tough when the weather is so good and work is so busy.
    Today, 11:02 AM
  • PrintDriver
    Reply to How to cut down on meetings?
    PrintDriver
    Do you have any kind of contractual explanation on the amount of meetings you have accounted for in your quote?
    Lately I've noticed you almost have to do this just to avoid running all over the...
    Today, 10:59 AM
  • jessica21
    Steampunk Tea Brand Logo Critique- Trying to choose final concept
    jessica21
    Hello All,

    Background:
    I am making a logo for my boyfriend's tea company, Starlight Tea. It sells high quality loose leaf tea, will have a website, and be in a local cafe (it's more...
    Today, 05:52 AM
  • Buda
    How to cut down on meetings?
    Buda
    I have a client who I am going to design a book for. I met with her about 4-5 months ago to discuss. She emails me each month to tell me she hasn't advanced any further on the project. She's been overseas...
    Today, 05:25 AM
  • skribe
    Reply to Crisp web graphics, how?
    skribe
    It sounds to me like you are hitting a retina issue. When I look at your site the graphics look fine to me on my 25" monitor. I just googled "SquareSpace Retina Support" and quickly...
    Today, 05:24 AM
Advertisement Advertisement Module
Collapse

Sponsors Sponsors Module
Collapse

X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Question about setInterval in Flash 8

    I was always wondering about how to use setInterval correctly in Flash 8 , as I can't clearly know the meaning of this script . Could anyone who can explain a bit for me ? Thanks in advance!
    http://www.liuhuan.com

    Decayedwood design .

  • #2
    Is there any difference in setting setInterval in functions and in root timeline?
    http://www.liuhuan.com

    Decayedwood design .

    Comment


    • #3
      setInterval keeps a function repeating indefinitely. Here's an example:

      function setIntervalExample() {
      trace("This message will repeat ten times.");
      loopThis++;
      if (loopThis >= 10) {
      clearInterval(testInterval);
      }
      }

      var testInterval:Number = setInterval(setIntervalExample, 1000);


      Basically that trace message would repeat indefinitely if I had not put that if/else loopThis statement to clear the interval after ten times. The "1000" in the testInterval variable is the milliseconds it repeats so you can speed it up or slow it down by playing with the number.

      Comment


      • #4
        Thanks very much !!

        A few other questions , how about if I define the Interval in function ?

        For example :

        function myfunction(){
        var testInterval = setInterval(this , setIntervalExample, 1000);
        }

        function setIntervalExample(){
        trace("This message will repeat ten times.");
        loopThis++;
        if (loopThis >= 10) {
        clearInterval(testInterval);
        }
        }

        myfunction();


        Do these codes have the same results with your code ?
        http://www.liuhuan.com

        Decayedwood design .

        Comment

         
        home | site map | advertising/sponsorships | about us | careers | contact us | help courses | browse jobs | freelancers | events | forums | content | member benefits | reprints & permissions about | terms of use | privacy policy | Copyright © 2014 Mediabistro Inc. Mediabistro Inc. call (212) 389-2000 or email us
        Working...
        X