# Why does timer event not start function?

**URL:** <https://forum.kirupa.com/t/why-does-timer-event-not-start-function/317640>\
**Category:** flash\
**Created:** [December 28, 2010, 12:43pm UTC](https://forum.kirupa.com/t/why-does-timer-event-not-start-function/317640 "2010-12-28T12:43:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jaxz](https://avatars.discourse-cdn.com/v4/letter/j/c6cbf5/32.png) [@jaxz](https://forum.kirupa.com/u/jaxz)\
**Post date:** [December 28, 2010, 12:43pm UTC](https://forum.kirupa.com/t/why-does-timer-event-not-start-function/317640/1 "2010-12-28T12:43:13Z")

</div>

Pls help, I have spent a week trying to find this bug.

I have a function that fades out sound. It works perfectly well, yet the mirror of that which is supposed to fade IN my sounds does not start looping.

Code as follows:

```auto

// ****Query Dec 28 2010**** //
function fadeinsong(e:Event = null): void // To gradually fade in volumes 
{
	e.currentTarget.removeEventListener(Event.COMPLETE, fadeinsong); 	
	var Fade_in_timer:Timer = new Timer(20, 50); // 20ms for up to 50 x 
	timers.push(Fade_in_timer);	// into array for timer handling

Fade_in_timer.addEventListener( TimerEvent.TIMER, VOL_up,false, 0, true);  
		function VOL_up(e:TimerEvent):void	
		{					
			setVol +=dV; // increment dV is 0.025 units
			adjustVolume(e);	// updates all volumes 
			if ( setVol >= Vol ) { // to break 
				Fade_in_timer.stop();  
                           }
		} // end func																														
Fade_in_timer.start();	
}

```

The issue is that the Fade\_in\_timer calling VOL\_up never starts looping.  
And the very same code works well when dV is subtracted from setVol  
Note: setVol, dV and Vol are global variables defined at the top of my main code. “timers” is an array to keep track of all new timers in case I need to stop them all and remove them.

Note: the other fadeout function that works well only differs in the names of the timer and the stop criterion and that setVol is decreased gradually.  
I have tried “everything” - please help!!!  
Cheers,  
Jaxz
