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

  • Sheesko
    Reply to My logo as a designer
    Sheesko
    Is there some reason why you wouldn't use the avatar we see here as your logo, with your name below or beside it in a solid sans font when needed? I think the avatar is great and would make a terrific...
    Today, 02:22 AM
  • vaprarts
    Reply to critique my branding attempt
    vaprarts
    I was thinking of sizes all the way down to a favicon 16px x 16px Ill hop back on the sketching.. Im less worried about the branding now as i realize i dont need it.. At the same time being its for myself...
    Yesterday, 11:40 PM
  • sybli
    Comment on How well do you see color? (fun & games)
    sybli
    Lol, yeah, you have one minute to get as many as you can . But I'm not surprised the cookies won. The always wi..*nom* *nom* *nom*.
    Yesterday, 09:52 PM
  • Ryukori
    Hello GDF
    Ryukori
    Hello everyone, I'm from Canada and I've been completing graphics requests for over 3 years. I mainly use Adobe Photoshop and Illustrator software.
    Yesterday, 09:33 PM
  • <b>
    Reply to Friend as a client - problem
    <b>
    You know, I wouldn't really consider it a complete loss. Looking back, I made some mistakes early in my career that cost me money. At the time, I was upset, but the money I've saved by heeding what I...
    Yesterday, 09:25 PM
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

        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 © 2014 Mediabistro Inc. call (212) 389-2000 or email us
        Working...
        X