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

Latest Topics Latest Topics Module
Collapse

  • seamas
    Reply to Print portfolio to interview?
    seamas
    I don't think that is a good idea at all.

    I would ONLY bring the best and most relevant 12-12 pieces.

    It is pretty much a given that EVERYONE coming into an interview was not...
    Today, 02:18 PM
  • bubby17346
    Reply to Print portfolio to interview?
    bubby17346
    Embarrassing how? If they are not necessarily good projects in your opinion, you could try to use them to show what you have improved and what obstacles those projects helped you overcome. Another thing...
    Today, 02:08 PM
  • B
    Reply to Properly font pairing recommendation
    B
    The typeface used in a logo isn't usually coordinated with whatever other type is used. Ideally, it might be, but logos last a long time and restricting all subsequent typography used on everything for...
    Today, 01:41 PM
  • KitchWitch
    Reply to Haii !
    KitchWitch
    Hi Erick and welcome to GDF.

    We ask all new members to read very important links here and here. These explain the rules, how the forum runs and a few inside jokes. No, you haven't done...
    Today, 01:10 PM
  • frutiger
    Reply to Print portfolio to interview?
    frutiger
    Thanks everyone! I guess I'll take some of the same pieces that are online. I have lots of printed pieces, but some are just really embarrassing to show!
    Today, 12:56 PM

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

        Mediabistro A division of Prometheus Global Media home | site map | advertising/sponsorships | careers | contact us | help courses | browse jobs | freelancers | content | member benefits | reprints & permissions terms of use | privacy policy Copyright © 2015 Mediabistro Inc.
        Working...
        X