# "refreshing" LoadVars

**URL:** <https://forum.kirupa.com/t/refreshing-loadvars/301767>\
**Category:** flash\
**Created:** [December 15, 2009, 10:11am UTC](https://forum.kirupa.com/t/refreshing-loadvars/301767 "2009-12-15T10:11:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ebichu](https://avatars.discourse-cdn.com/v4/letter/e/a9adbd/32.png) [@ebichu](https://forum.kirupa.com/u/ebichu)\
**Post date:** [December 15, 2009, 10:11am UTC](https://forum.kirupa.com/t/refreshing-loadvars/301767/1 "2009-12-15T10:11:40Z")

</div>

Hi.

I’m getting and parsing a json feed for an online radio station.  
The json feed gives me played and left time and pecentage of the song progress etc.  
The problem is, that i can successfully display everything i need, but the problem happens when the song finishes.  
i’m using setInterval to take off a second in ‘remaining time’ text box, and i need it to refresh, after one song is finished, but it doesn’t, it just goes into a negative value.

the code for left time:

```auto
function rem (){
    var aegj:String = seconds2time(left--); //this is a custom function for converting seconds into mm:ss
    aeg.text = "-"+aegj;
        if(left == 0){
        jsonFetcher.load("my_json_feed.php");
    };
};

```

it _should_ just refresh the variables, right? but why doesn’t it do so?

some code in jsonFetcher.onData:

```auto
jsonFetcher.onData = function(thedata) {
    try {
        var json = new JSON();
        var o:Object = json.parse(thedata);
        _global.left = o.nowplaying.length - o.nowplaying.played;

//etc

```

Help, please!!
