# Applying a timer to a slider\_mc

**URL:** https://forum.kirupa.com/t/applying-a-timer-to-a-slider-mc/268670
**Category:** Uncategorized
**Created:** [August 17, 2008, 1:13am UTC](https://forum.kirupa.com/t/applying-a-timer-to-a-slider-mc/268670 "2008-08-17T01:13:57Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![dbase](https://avatars.discourse-cdn.com/v4/letter/d/ecae2f/32.png) [@dbase](https://forum.kirupa.com/u/dbase)
#### Post date: [August 17, 2008, 1:13am UTC](https://forum.kirupa.com/t/applying-a-timer-to-a-slider-mc/268670/1 "2008-08-17T01:13:57Z")

</div>

I have a slider\_mc which is currently being controlled by a mouse action

* * *

var value = 0;  
bar.\_x = value;  
bar.onPress = function(){  
this.onMouseMove = slideMouseMove;  
}  
bar.onRelease = bar.onReleaseOutside = function(){  
delete this.onMouseMove;  
}  
function slideMouseMove(){  
this.\_x = Math.min(Math.max(0, this.\_parent.\_xmouse), 100);  
value = this.\_x/100;  
this.\_parent.onChanged(value);  
}  
this.onChanged(value);

* * *

how can I apply a timer to automatically move the slider? eg a timer to count from 0 to 100 or alt replace the slider with a timer so that the image gradually changes from grey to color

here is the source [http://www.senocular.com/flash/files/desaturateimage.fla](http://www.senocular.com/flash/files/desaturateimage.fla)
