Graizik
Graizik

Reputation: 13

Can't find the bug in my code

The code is:

 var _bgin:Date = new Date();
    var _end:Date   = new Date();
    function sineWaveGenerator(b_arr:ByteArray,p:int, w:uint = 1):void {
        _bgin = _end;
        _end = new Date();
        var st:uint =  
            _end.valueOf() - 
            _bgin.valueOf(); // line 179
    }

The error message:

TypeError: Error #1009: Cannot access a property or method of a null object reference. at stopAllExample_fla::MainTimeline/sineWaveGenerator()[stopAllExample_fla.MainTimeline::frame1:179]

I call the function from an event handler. The error appears only once and no error in the all following funcion calls.

Upvotes: 0

Views: 55

Answers (1)

Graizik
Graizik

Reputation: 13

I had to move the initial definitions of the globals up

Upvotes: 1

Related Questions