[RESOLVED] Help to fade-in pictures
Hey!
I've made this picture slideshow.
It got 6 buttons, used as navigation between pictures. It works fine. But i want to add some fade in & out when the buttons is pushed. I've tried a couple of diffrent codes, but i can't manage to solve it.
Code loke like this:
import flash.events.MouseEvent;
button1.addEventListener(MouseEvent.CLICK,showpic1 );
button2.addEventListener(MouseEvent.CLICK,showpic2 );
button3.addEventListener(MouseEvent.CLICK,showpic3 );
button4.addEventListener(MouseEvent.CLICK,showpic4 );
button5.addEventListener(MouseEvent.CLICK,showpic5 );
button6.addEventListener(MouseEvent.CLICK,showpic6 );
button_1.addEventListener(Event.ENTER_FRAME, fadebutton_1ind);
button_1.alpha = 0;
function showpic1(Event:MouseEvent):void{
gotoAndStop("billed1");
}
function showpic2(Event:MouseEvent):void{
gotoAndStop("billed2");
}
function showpic3(Event:MouseEvent):void{
gotoAndStop("billed3");
}
function showpic4(Event:MouseEvent):void{
gotoAndStop("billed4");
}
function showpic5(Event:MouseEvent):void{
gotoAndStop("billed5");
}
function showpic6(Event:MouseEvent):void{
gotoAndStop("billed6");
}
function fadebutton_1ind(event:Event)
{
button_1.alpha += 0.1;
if(button_1.alpha >= 1)
{
button_1.removeEventListener(Event.ENTER_FRAME, fadebutton_1ind);
}
}
And i still doesnt work.
Hope you understand my problem
Link to the flash in action:
Sport-Helse.dk