# Do this effect for all picx .\_Question\_

**URL:** <https://forum.kirupa.com/t/do-this-effect-for-all-picx--question-/185638>\
**Category:** Uncategorized\
**Created:** [April 14, 2006, 8:54pm UTC](https://forum.kirupa.com/t/do-this-effect-for-all-picx--question-/185638 "2006-04-14T20:54:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lucid212](https://avatars.discourse-cdn.com/v4/letter/l/dc4da7/32.png) [@lucid212](https://forum.kirupa.com/u/lucid212)\
**Post date:** [April 14, 2006, 8:54pm UTC](https://forum.kirupa.com/t/do-this-effect-for-all-picx--question-/185638/1 "2006-04-14T20:54:38Z")

</div>

Hi kirupa

I’m building a flash web site, this site contain images in 5 pages,  
i want to do an effect when rollover of any image ( make image brightness  
100 and fade to 0 ).

```
                                               many thx
```

---

<div class="post-metadata">

**Author:** ![hybrid101](https://avatars.discourse-cdn.com/v4/letter/h/7993a0/32.png) [@hybrid101](https://forum.kirupa.com/u/hybrid101)\
**Post date:** [April 15, 2006, 3:29am UTC](https://forum.kirupa.com/t/do-this-effect-for-all-picx--question-/185638/2 "2006-04-15T03:29:15Z")

</div>

convert them to movieclips and tween them?

---

<div class="post-metadata">

**Author:** ![TheCanadian](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@TheCanadian](https://forum.kirupa.com/u/TheCanadian)\
**Post date:** [April 15, 2006, 4:56am UTC](https://forum.kirupa.com/t/do-this-effect-for-all-picx--question-/185638/3 "2006-04-15T04:56:43Z")

</div>

For a movie clip with instancename _mc_:

```auto
//Color.setBrightness by Robert Penner June 2001 - www.robertpenner.com
Color.prototype.setBrightness = function(bright) {
 var percent = 100 - Math.abs(bright);
 var offset = 0;
 if (bright > 0) {
  offset = 256 * (bright / 100);
 }
 var trans = new Object();
 trans.ra = trans.ga = trans.ba = percent;
 trans.rb = trans.gb = trans.bb = offset;
 this.setTransform(trans);
};
mc.colour = new Color(mc);
mc.brightNum = 0;
mc.brightSpeed = 5;
mc.onRollOut = function():Void {
 this.onEnterFrame = function():Void {
  if (this.brightNum > 0 + this.brightSpeed) {
   this.brightNum -= this.brightSpeed;
  } else {
   this.brightNum = 0;
   delete this.onEnterFrame;
  }
  this.colour.setBrightness(this.brightNum);
 };
};
mc.onRollOver = function():Void {
 this.onEnterFrame = function():Void {
  if (this.brightNum < 100 - this.brightSpeed) {
   this.brightNum += this.brightSpeed;
  } else {
   this.brightNum = 100;
   delete this.onEnterFrame;
  }
  this.colour.setBrightness(this.brightNum);
 };
};

```

---

<div class="post-metadata">

**Author:** ![gvozden](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/gvozden/32/1084_2.png) [@gvozden](https://forum.kirupa.com/u/gvozden)\
**Post date:** [April 15, 2006, 8:28am UTC](https://forum.kirupa.com/t/do-this-effect-for-all-picx--question-/185638/4 "2006-04-15T08:28:47Z")

</div>

you could make functions out of that 😉

---

<div class="post-metadata">

**Author:** ![lucid212](https://avatars.discourse-cdn.com/v4/letter/l/dc4da7/32.png) [@lucid212](https://forum.kirupa.com/u/lucid212)\
**Post date:** [April 15, 2006, 7:41pm UTC](https://forum.kirupa.com/t/do-this-effect-for-all-picx--question-/185638/5 "2006-04-15T19:41:44Z")

</div>

Thx so much  
i convert photo to movieclip with instancename mc but it’s not working,  
excuse me i’m newbie to actionscript, please take a look at fla…

www.geocities.com/dutch\_delusion/mc.fla

```
                                                          I'd greatly appreciate it.
```
