# Need Help With Alpha Fade Technique!

**URL:** <https://forum.kirupa.com/t/need-help-with-alpha-fade-technique/12745>\
**Category:** flash\
**Created:** [February 4, 2003, 5:30am UTC](https://forum.kirupa.com/t/need-help-with-alpha-fade-technique/12745 "2003-02-04T05:30:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kelly\_Nunes](https://avatars.discourse-cdn.com/v4/letter/k/b5e925/32.png) [@Kelly\_Nunes](https://forum.kirupa.com/u/Kelly_Nunes)\
**Post date:** [February 4, 2003, 5:30am UTC](https://forum.kirupa.com/t/need-help-with-alpha-fade-technique/12745/1 "2003-02-04T05:30:51Z")

</div>

Hey Everyone,

Back again with another problem. I hope there’s someone out there who can help me. Here’s what’s happening. I am trying to create an effect where the user rolls his mouse over a pencil drawing. When he does this the pencil drawing fades out to reveal the same color image underneath.

I have the actionscript in place but it doesn’t fade out gradually as I’d like. There really is not fade, it just goes from pencil to color in a FLASH - pun intended! He, he, he… and that’s not what I want.

Anyway, the script looks like the following:

on(rollover){  
AgassiPencil.\_alpha = 0;  
)  
on(rollout){  
AgassiPencil.\_alpha = 100;  
}

I know I’m missing something, so if there is anything you can do to help me I’d appreciate it.

Thanks,

Kelly =)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 4, 2003, 5:59am UTC](https://forum.kirupa.com/t/need-help-with-alpha-fade-technique/12745/2 "2003-02-04T05:59:04Z")

</div>

er…correct me if I’m wrong…

but if appears as though your AS is doing just what you told it to do…go from 0 to 100 in 1 msec 😛

You’ll have to stick in a function that gradually shows the image…maybe this’d work:

```php

alpha_pencil = AgassiPencil._alpha;
on(rollover){
alpha_pencil = 0;
while (alpha_pencil < 100)
{
alpha_pencil += 20;
}
)
on(rollout){
alpha_pencil = 0;
while (alpha_pencil < 0)
{
alpha_pencil -= 20;
}
}

```

I’m assuming that’d work, haven’t tested it…

you might have to use a setProperty command…but I hoesntly don’t know, but that’s what I’d start with and work off of…

(I only know some php and c++…and I’m a n00b in AS)  
}

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 4, 2003, 6:17am UTC](https://forum.kirupa.com/t/need-help-with-alpha-fade-technique/12745/3 "2003-02-04T06:17:42Z")

</div>

Hey Pewter,

Thanks for the help. I will give your script a try and see what happens. I’ll ket you know. Thanks again.

Sincerely,

Kelly:+)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 5, 2003, 3:56am UTC](https://forum.kirupa.com/t/need-help-with-alpha-fade-technique/12745/4 "2003-02-05T03:56:26Z")

</div>

I wrote a prototype for this… maybe this thread will help…

[http://www.kirupaforum.com/showthread.php?s=&threadid=13239](http://www.kirupaforum.com/showthread.php?s=&threadid=13239)

(note: my help to read whole thread there, there is a corrected script as well)
