A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Repeat code every 30 seconds

  1. #1
    Junior Member
    Join Date
    Jun 2002
    How would this be done? I would like to update a hit counter every 30 seconds. If my code worked right, it would update every half a second (maybe that's way nothing is displaying), but I only want it to update every 30 seconds.

    My code doesn't display anything in the movie's text field, but the swf plays fine other wise. It is in frame1, and the topmost layer. How would I change it to execute every 30 seconds instead of everytime frame1 is played?

    loadVariablesNum("flashcounter.php", 0);

    Is there something I should change to make it work?
    The "flashcounter.php" file just opens a text file and outputs "Counter=" and then the number from the text file on the screen. I have the text field variable named as Counter.

    Any advice for me?

    Thanks a lot =)

  2. #2
    Join Date
    Apr 2002
    make your code a function then call the function and do this:

    setInterval(functionName, 30000);

  3. #3
    Junior Member
    Join Date
    Jun 2002
    I've put the code in, but it says it's in "Frame1" and it gets called every second. Where do I put my function and the setInterval(CountIt,30000); line?

    I don't see an area for user defined functions or flash commands. I would like to put the code in a general area, not in a frame. Could someone help me out with this?


  4. #4
    Senior Member
    Join Date
    Oct 2000

    i think...

    ... you can place it in a stopped mc, frame 2. You can give this mc the name "all functions" or something like that.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width

HTML5 Development Center