# Timed function

**URL:** https://forum.kirupa.com/t/timed-function/178346
**Category:** Uncategorized
**Created:** [February 9, 2006, 5:20pm UTC](https://forum.kirupa.com/t/timed-function/178346 "2006-02-09T17:20:07Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![aphexburn](https://avatars.discourse-cdn.com/v4/letter/a/9d8465/32.png) [@aphexburn](https://forum.kirupa.com/u/aphexburn)
#### Post date: [February 9, 2006, 5:20pm UTC](https://forum.kirupa.com/t/timed-function/178346/1 "2006-02-09T17:20:07Z")

</div>

I’ve been playing with some script I found on the net and Its pretty cool what it does. It looks through records from a csv file (basiclly excel) and displays them. It works fine moving from record to record but how would I tweak this with set interval so it would change on it own?

```auto

showPerTime = 1;
// declare variables and constants 
var loader = new LoadVars();
// load the file 
loader.load("list.csv");
loader.onData = function(dat) {
 
 //trace(dat);// split on 
 for files on windows server
 var input_arr = dat.split('
');
 // split on 
 for files on linux servers
 if (input_arr.length == 1) {
  input_arr = dat.split('
');
 }
 var fields = input_arr[0].split(',');
 function showDataFrom(a, b) {
  //trace(showDataFrom);
  cEnd = b;
  
  for (var c = 0; c<fields.length; c++) {
   _root.mcText[fields[c]].text = '';
  }
  for (var x = a; x<=b; x++) {
   var citem = input_arr[x].split(',');
   if (b>=input_arr.length) {
    fwd.enabled = false;
    fwd._alpha = 50;
   } else if (a<=1) {
    bk.enabled = false;
    bk._alpha = 50;
   }
   for (var y = 0; y<citem.length; y++) {
    _root.mcText[fields[y]].text += citem[y]+'
';
   }
  }
 }
 showDataFrom(1, showPerTime);
 fwd.onRelease = function() {
  bk.enabled = true;
  bk._alpha = 100;
  showDataFrom(cEnd+1, cEnd+showPerTime);
 };
 bk.onRelease = function() {
  fwd.enabled = true;
  fwd._alpha = 100;
  showDataFrom(cEnd-showPerTime*2+1, cEnd-showPerTime+0);
 };
};

```

Thanks for any and all help!!!
