hi again everyone,
yet another question about AS3
i have several buttons on a frame and have their alpha values set to 50% using the properties bit at the bottom after id converted them into Button's. anyhoo, my coding works fine and dandy, navigation works fine and all that, BUT i want to set it so that when i hover my mouse over a button the alpha value "fades" up to 100%, and then when i take my mouse button back off again it fades back down to 50%. i have tried so hard to get this to work, but i just cant

anyway, here's a copy of my script:
Code:
//freezes page
stop();
// event listeners
mainAdult.addEventListener(MouseEvent.MOUSE_OVER, increaseAlpha);
mainAdult.addEventListener(MouseEvent.MOUSE_OUT, decreaseAlpha);
mainChild.addEventListener(MouseEvent.ROLL_OVER, increaseAlpha);
mainChild.addEventListener(MouseEvent.ROLL_OUT, decreaseAlpha);
mainAdult.addEventListener(MouseEvent.MOUSE_DOWN, onClickMainAdult);
mainChild.addEventListener(MouseEvent.MOUSE_DOWN, onClickMainChild);
//functions
function onClickMainAdult(evt:MouseEvent):void {
gotoAndStop("adultIntro");
}
function onClickMainChild(evt:MouseEvent):void {
gotoAndStop("childIntro");
}
function increaseAlpha(evt:MouseEvent):void{
evt.currentTarget.alpha += 5;
if (evt.currentTarget.alpha >= 100)
{
evt.currentTarget.alpha = 100;
}
}
function decreaseAlpha(evt:MouseEvent):void{
evt.currentTarget.alpha -= 5;
if (evt.currentTarget.alpha <= 50)
{
evt.currentTarget.alpha = 50;
}
}
if you could tell me where ive gone wrong or point me in the correct direction that would be great, thanks
EDIT: oh and the reason im using evt.currentTarget is because i would like this function to be usable by as many buttons as i would like, rather than having to make a whole new function for every button, cause that just gets really messy and inefficient.