# Out of scope issue

**URL:** <https://forum.kirupa.com/t/out-of-scope-issue/241615>\
**Category:** flash\
**Created:** [October 16, 2007, 5:37am UTC](https://forum.kirupa.com/t/out-of-scope-issue/241615 "2007-10-16T05:37:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![shaji](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@shaji](https://forum.kirupa.com/u/shaji)\
**Post date:** [October 16, 2007, 5:37am UTC](https://forum.kirupa.com/t/out-of-scope-issue/241615/1 "2007-10-16T05:37:11Z")

</div>

Hi All

I am developing an application to display different time zones. Class works fine only once, later it fails to update the movie with dials of clock. I not sure what could be the issue, I am using delegates as methods weren’t called previously.

```auto

import mx.utils.Delegate;
//
class ClockEngine {
    var sec:Date;
    var ts:Number;
    var clock_mc:MovieClip;
    // 
    function ClockEngine (mc:MovieClip, timeofset) {
        clock_mc = mc;
        ts = timeofset;
        var localTime:Date = new Date ();
        sec = new Date ();
        animate();
    }
    function animate()
    {
        setInterval(Delegate.create (this, init), 1000);
    }
    public function init ():Void {
        ///
        
        var hours:Number = (Math.round (ts)*60)/60;
        var minutes:Number = Math.abs (Math.round (ts)-ts)*100;
        var seconds:Number = sec.getSeconds ();
        hours += sec.getUTCHours ();
        minutes += sec.getUTCMinutes ();
        trace (ts+" "+hours+" "+minutes+" "+seconds);
        trace("---------------------------------------------");
        ///
        clock_mc.secondHand_mc._rotation = seconds*6;
        clock_mc.minuteHand_mc._rotation = minutes*6;
        clock_mc.hourHand_mc._rotation = (hours)*30+(Math.round ((minutes*6)/12));
        clock_mc.hourHand_mc.showTime_txt.text= "hello";
    }
}

```

I noticed in the trace seconds value doesn’t seem to change, neither does minutes. Values in red are seconds.

```auto

5.3 10 59 [COLOR=Red]50[/COLOR]
---------------------------------------------
5.3 10 59 [COLOR=Red]50[/COLOR]
---------------------------------------------
5.3 10 59 [COLOR=Red]50[/COLOR]
---------------------------------------------
5.3 10 59 [COLOR=Red]50[/COLOR]
---------------------------------------------
5.3 10 59 [COLOR=Red]50[/COLOR]
---------------------------------------------

```

I am new to using classes.

Thanks
