# MX 2004 - brightness in/out on rollover

**URL:** <https://forum.kirupa.com/t/mx-2004-brightness-in-out-on-rollover/174121>\
**Category:** flash\
**Created:** [January 3, 2006, 3:29am UTC](https://forum.kirupa.com/t/mx-2004-brightness-in-out-on-rollover/174121 "2006-01-03T03:29:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![caustic](https://avatars.discourse-cdn.com/v4/letter/c/b782af/32.png) [@caustic](https://forum.kirupa.com/u/caustic)\
**Post date:** [January 3, 2006, 3:29am UTC](https://forum.kirupa.com/t/mx-2004-brightness-in-out-on-rollover/174121/1 "2006-01-03T03:29:44Z")

</div>

What I’m trying to achieve is have my images “flash/shine” when the cursor passes over the image, however; I want it to adjust to say +100, then back down to 0 immediately, not on roll out. The code I have thus far works perfectly fine for over and out. Anyone have an idea?

```auto

sBright = 0;
eBright = 100;
stepValue = 25;

myColor = new Color(xt10);
myColorTransform = new Object(); 
myColorTransform.rb = 0;
myColorTransform.gb = 0;
myColorTransform.bb = 0; 
myColor.setTransform(myColorTransform);

this.xt10.onRollOver = function() {
    this.onEnterFrame = function() {
                if(myColor.getTransform().rb<eBright) {
                    myColorTransform.rb += stepValue;
                    myColorTransform.gb += stepValue;
                    myColorTransform.bb += stepValue; 
                    myColor.setTransform(myColorTransform);
                }
              // need to go back to 0 here somehow
        }; 
} 

this.xt10.onRollOut = function() {
    this.onEnterFrame = function() {
                if(myColor.getTransform().rb>sBright) {
                    myColorTransform.rb -= stepValue;
                    myColorTransform.gb -= stepValue;
                    myColorTransform.bb -= stepValue; 
                    myColor.setTransform(myColorTransform);
                }
        };
} 

```
