How to fade in and out a picture with frames?

I’ve searched the posts for an answer to this question, but I haven’t found one yet! Can you help? I have a main_test.fla that has some item buttons. When you click on an item button, the content1.fla loads the content to frame 15. If you click on another item button, frame 16 and following loads:

PRELOAD–(content fades in)---->STOP–(content fades out)---->LOAD NEXT ITEM

With this function on content1.fla, I’m trying to figure out how I can fade in a picture and then fade out a picture using actionscript??

I know this is possible using tweens, but is it possible to use actionscript?

Right now I have the following code for the picture to fade in, and I tried to mention that the fade out should occur after frame 16, but it does not work. Is there anything I could use that would work? :frowning:

init = function () { 
        this.myContainer = this.createEmptyMovieClip("cont", 1); 
    cont._x = 230; 
    cont._y = 60; 
        this.myContainer._alpha = 0; 
        this.myContainer.loadMovie("giraffe.swf"); 
        this.preloadJpg(); 
        }; 

preloadJpg = function() { 
        this.onEnterFrame = function() { 
                if (this.myContainer.getBytesLoaded()>100 && this.myContainer.getBytesLoaded()>=this.myContainer.getBytesTotal()) { 
                        this.fadePicIn(); 
                if (this._currentframe ==16) 
                        this.fadePicOut(); 
                        } 
        }; 
}; 
fadePicIn = function() { 
        if(this.myContainer._alpha < 100){ 
                this.myContainer._alpha += 10; 
        } else { 
                this.onEnterFrame = undefined; 
        } 
} 
fadePicOut = function() { 
        if(this.myContainer._alpha > 100){ 
                this.myContainer._alpha -= 10; 
        } else { 
                this.onEnterFrame = undefined; 
        } 
} 
this.init();

I’ll attach my files to this post! If you click on an item button on the main_test.swf, you’ll see that the giraffe will fade in. However, if you click another item button, he won’t fade out. He’ll just disappear. :frowning:

Thanks for your help!