AS Problem with a while loop

Ok, This one is going to be really easy… at least I think it should be, I just can’t get it.

I’m trying to make a photo gallery in flash and I put my pictures in a mc in order with stops and everything. Now im working on my buttons and I want the movie clip to fade out - change the picture - fade back in. This is the code I was going to use… Until my while loop just made the mc vanish (not fade)


on(press) {

while(photos._alpha > 0)
photos._alpha -=2;

}

That was going to make the mc fade out but it doesn’t work anyone have any ideas.