# Arrgh! Why can't I do this? Am I stupid?

**URL:** <https://forum.kirupa.com/t/arrgh-why-cant-i-do-this-am-i-stupid/21451>\
**Category:** Uncategorized\
**Created:** [May 21, 2003, 6:54pm UTC](https://forum.kirupa.com/t/arrgh-why-cant-i-do-this-am-i-stupid/21451 "2003-05-21T18:54:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![TaskMaster\_OOC](https://avatars.discourse-cdn.com/v4/letter/t/a88e57/32.png) [@TaskMaster\_OOC](https://forum.kirupa.com/u/TaskMaster_OOC)\
**Post date:** [May 21, 2003, 6:54pm UTC](https://forum.kirupa.com/t/arrgh-why-cant-i-do-this-am-i-stupid/21451/1 "2003-05-21T18:54:24Z")

</div>

Ok, don’t bother answering my “Am I stupid?” question - we already know where that’s going.

Hey thar, phellow phorum phreaks!

I am throughly frustrated, as you might have guessed by my subject. I’m trying to do something simple, but because of my lack of intelligence, or some other fault, I can’t make it work. Here’s my dilema:

I’ve got a picture imported into a flash item (of course) and I want it to behave as follows. Normally, it will be faded to 50% alpha, but when the cursor is moved **over** it, not clicking on it, just moving over it) the picuture is faded in all the way (100% alpha). It doesn’t need to be a link or anything else; that’s the complete task of the picture. This should be hard, should it?

I’ve only been using Flash for a little less than a month now, and have found this website, its tutorials, and especially the forum to be of invaluable help, so I thought I’d become a member of this esteemed collective and pose my query to the masses. I hope I can eventually become a worthwhile member here as well.

Thank you for your assistance.

_TaskMaster_[OOC]

---

<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:** [May 21, 2003, 7:38pm UTC](https://forum.kirupa.com/t/arrgh-why-cant-i-do-this-am-i-stupid/21451/2 "2003-05-21T19:38:11Z")

</div>

This will do what you are looking for, just turn your picture into a movie clip and apply this code to it. I commented every line of the code to help you understand what is going on.

```auto

//when you move the mouse over the picture
on (rollOver){
	
	/* this speed variable makes it easy to adjust the speed
	it is the % the fade will change every frame */
	speed = 5;
	
	/* this line causes a function to be executed using
	onEnterFrame, this means the function will be executed
	at the speed of your framerate */
	this.onEnterFrame = function(){
		
		//check to see if the picture has faded in 100%
		if (this._alpha < 100){
			
			//if not increase it by whatever speed is
			this._alpha += speed;
			
		//if it has faded in 100%
		} else {
			
			//get rid of the function occuring onEnterFrame
			delete this.onEnterFrame;
		}
	}
}

//when you move the mouse off of the picture
on (rollOut){
	
	/* Same as above, execute the following function at
	the current frame rate */
	this.onEnterFrame = function(){
		
		//check if the fade is still above 50%
		if (this._alpha > 50){
			
			//if it is then decrease it by whatever speed is
			this._alpha -= speed;
			
		//if it is at or below 50%
		} else {
			
			//get rid of the function
			delete this.onEnterFrame;
		}
	}
}

```

---

<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:** [May 21, 2003, 8:32pm UTC](https://forum.kirupa.com/t/arrgh-why-cant-i-do-this-am-i-stupid/21451/3 "2003-05-21T20:32:23Z")

</div>

Great!

That was exactly what I was looking for, of course! I’ll learn this all someday, I swear, but by that point, Flash Super MX 10.5 will be out I’ll have to catch up even more. Anyway, I appreciate the help.

_TaskMaster_[OOC]
