Easy Button Question

Hey Everybody, here’s an easy one.

I need to make a button fade out to almost transparent and then fully fade in when the mouse is moved over it.

This is my first attemp at doing things without a tutorial and I can’t quite figure the code out, but I know one of you guys can help me.

Much appreciation…:beam:


onClipEvent (enterFrame) {
	if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
		alpha = 100
	} else {
		alpha = 20
	}
	this._alpha += (alpha - this._alpha) / 4
}

since you seem like a smart guy … use the actionscript dictionary to find out how the code works :beam:

by the way … don’t use a button … use a movie clip instead

[size=1]if you place those actions in a button flash will throw an error like this:
clip events are permitted only for movie clip instances bla … bla … bla .[/size]

Use a button handler with your movie clip, instead of an enterFrame+hitTest.

theClip.onRollOver=function(){…}

Thanks fellas…It actually dawned on me as soon as I logged off
last night. I used the button handlers but I was actually looking for
code more like Kax’s. I may switch to that. Thanks again…