# AS Problem with a while loop

**URL:** <https://forum.kirupa.com/t/as-problem-with-a-while-loop/79117>\
**Category:** flash\
**Created:** [February 11, 2005, 1:04am UTC](https://forum.kirupa.com/t/as-problem-with-a-while-loop/79117 "2005-02-11T01:04:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jep214](https://avatars.discourse-cdn.com/v4/letter/j/0ea827/32.png) [@Jep214](https://forum.kirupa.com/u/Jep214)\
**Post date:** [February 11, 2005, 1:04am UTC](https://forum.kirupa.com/t/as-problem-with-a-while-loop/79117/1 "2005-02-11T01:04:15Z")

</div>

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)

```auto

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.
