Fade in set interval Fade out

Update: I have this working now and have adjusted the code accordingly. Still can’t use buttons to tell it what frame to go to though? Any suggestions?

I am trying to write a script that will take an image in a Movieclip fade it in wait for a specified amount of time and then go to the next frame and do the same thing with the next image in a movieclip, so they will act as a slideshow or there will be buttons to tell it to go to the specified frame and fade in to the image.

I am able to get it to fade in show the image for 5 seconds then it doesn’t fade out just jumps to the next frame. Any input would be appreciated and if you help I would love an explanation as well so I can better understand what is happening.

I am using MX04.

This is my code so far for each frame. Its kind a mess now as I am lost but here goes.

var frameNumber:Number = 2
var myMc = golfmc;
stop();
speed = 3;
myMc._alpha = 0;
myMc.onEnterFrame = function () {
if (myMc._alpha < 100) {
myMc._alpha += speed;
}
else {
var interval:Number = setInterval(function () {
clearInterval(interval);
trace (“Frame 1”);
myMc.onEnterFrame = function () {
if (myMc._alpha > 0) {
myMc._alpha -= speed;
}
else {
delete myMc.onEnterFrame;
gotoAndStop(frameNumber);

            }
        }
    }, 2000);
    delete myMc.onEnterFrame;
}

}