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

  • True G
    wordpress theme
    True G
    Hello, i have downloaded a theme called lotus from theme forest, and trying to install the the template for my website, but i am trying to
    find the file to help me upload the template ( lotus) for...
    Today, 03:00 PM
  • PrintDriver
    Reply to Assignment help for newbie
    PrintDriver
    I gotta point out again, A storyboard is different from a webpage mockup. While you can use sketched page mockups in a storyboard, what you should be showing is the file structure of the site itself,...
    Today, 02:44 PM
  • ninjapiraatti
    Reply to SVG rendering: fonts and curves
    ninjapiraatti
    I'm using Affinity Designer. The file is 200px by 200px but it's shrank to 80 by 80. It doesn't matter what size it's displayed though, the jagged edges remain. I tried the conversion in two ways. First...
    Today, 02:34 PM
  • PanToshi
    Comment on Come here often?
    PanToshi
    Dang! a whole plate of 'em? Nice score newbie.
    Today, 01:40 PM
  • KitchWitch
    Reply to Come here often?
    KitchWitch
    Newbies get mini tacos. You gotta stick around a while to get a big one.

    ...
    Today, 01:30 PM

Powered by mediabistro.com
Mediabistro Creative Sites Mediabistro Creative Sites 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 © 2015 Mediabistro Inc.
        Working...
        X