Dear all,
I am making my first website in flash based on frames. When you go to an other frame the Stage fades out. When you enter the frame you see nothing at all. So how can I clear the stage when entering the frame or even better it fades into the frame with clearing the objects & code of the previous frame.
Hope somebody can help me with this!
/*buttons naar frames*/
homehome.mouseChildren = false;
homehome.buttonMode = true;
homehome.addEventListener(MouseEvent.CLICK, actie5);
homehome.addEventListener(MouseEvent.ROLL_OVER, actie5);
homehome.addEventListener(MouseEvent.ROLL_OUT, actie5);
var fadetimer:Timer;
var st:MovieClip = new MovieClip();
function actie5(event:MouseEvent):void {
//klikken
if(event.type == "click"){
st.graphics.beginFill(0xFFFFFF); //Choose your color to fade.
st.graphics.drawRect(0, 0, stage.stageWidth, stage.stageHeight);
st.graphics.endFill();
st.alpha = 0;
stage.addChild(st);
fadetimer = new Timer(100);
fadetimer.addEventListener(TimerEvent.TIMER, fadeStage);
fadetimer.start();
}
//roll over
if(event.type == "rollOver"){
infohome.text = "je staat op de knop";
}
//roll off
if(event.type == "rollOut"){
infohome.text = "";
}
}
function fadeStage(te:TimerEvent):void {
if (st.alpha < 1) {
st.alpha += 0.05;
} else {
fadetimer.stop();
fadetimer.removeEventListener(TimerEvent.TIMER, fadeStage);
gotoAndStop(7);
}
}
Thanks a lot for your time