Fade Image Out on Frame Change?

I’m so close to finishing my portfolio site update with an XML gallery and menu. However, I have multiple galleries, about 7-8. With the crazy timeline I have set up now, each gallery is on on its own frame about 20 frames apart, the menu uses a gotoAndPlay to another frame with a 20 frame animation and a stop(); on another gallery frame. What I would like to do is when another gallery is selected from the menu, have the last image of the current gallery fade out. So, what AS would I need to make the movieclip “picture” fade out when the frame is changed?

A shoutout to Scotty and Lindquist as well as all the tutorials for making this possible! You guys rock, hope I can be as helpful someday!

Some code would help…

scotty(-:

Sorry, should have thought about that. Here is a .zip with all my stuff in it. Its a flash 8 file, and the photos are just temps. You’ll see that I’m not doing a lot of things correctly at all. I really want a nice open fade on the menu, but couldn’t get a mask working, so I just took a screen shot and did the mask on that, ghetto flash! Any other critiques or suggestions welcome, when I get past all these first glitches and get things refined I’m going to post up for a formal critique.

http://www.jbnight.com/newsite.zip

Here it is posted up, not even centered:
http://www.jbnight.com/test/newsite-combined.html

Just found another bug. If you don’t click through at least one photograph, and then click directly on another gallery, the first image won’t load. I think I can see why in the AS, but I don’t even know where to start to fix it. Thanks again for your help!

You could try something like this

Actions.gotoAndPlay = function(gotoAndPlay) {
	if (_root.current != undefined) {
		_root.current.onEnterFrame = function() {
			this._alpha -= 7;
			if (this._alpha<0) {
				this._alpha = 0;
				_root.gotoAndPlay(gotoAndPlay);
				delete this.onEnterFrame;
			}
		};
	} else {
		_root.gotoAndPlay(gotoAndPlay);
	}
};

scotty(-:

Thanks scotty, that works beautifully! The transition speed 7 works perfect with my other animations, really smooth!

Now, I still can’t figure out what is going wrong with the last bug I found. If you click on one gallery, the first image pops up, and then if you immediately click to another gallery, the image loads, but doesn’t fade in at all.

I have a feeling its in here:
MovieClip.prototype.fadeIn = function() {
if (this._alpha<100) {
current._alpha -= 4;
this._alpha += 4;
} else {
current._visible = 0;
current = this;
delete this.onEnterFrame;
}
desc_txt.text = description[p];
picture_num();
};

I have been trying to incorporate the firstImage function you created for the gallery without the seperate preloader for each image, but without any luck. Any suggestions?

Note: I only have the images for the “Sanctuary” and “El Subte” galleries under “Argentina” in that zip file, so use those to see the bug.

Alright, after tinkering around, I’ve fixed the problem! I just put each gallery in a seperate .swf and used a loadmovie. Worked great. I do loose the nice fade out on gallery switch with the load movie though, too bad, looked nice, might try to see if I can find a way to get it back now.

However, I have since found yet another bug I’m running into. If you click through one gallery, and then go to another gallery, the arrow keys don’t work anymore. They skip photos, sometimes multiple photos. The first gallery you click through uses the arrow keys with no problem, but as soon as you go to another gallery they don’t work. This happens whether its a seperate .swf or not.

[COLOR=“Red”]Update:[/COLOR] I just found a fix for the arrow keys. I ditched the listener code in the main AS and put this code in the corresponding button AS. That combined with the loadmovie works.

  on (keyPress "&lt;Left&gt;") {
prevImage();
}
  on (keyPress "&lt;Right&gt;") {
  nextImage();
  }

Also, is there anyway to make the drop shadows work faster? I added one in actionscript to the FadeIn function and it really makes the whole site look much better, but ■■■■ those fades slow down and get jerky.

Thanks!