# Using AS to change what's on top

**URL:** https://forum.kirupa.com/t/using-as-to-change-whats-on-top/19338
**Category:** flash
**Created:** [April 26, 2003, 10:30pm UTC](https://forum.kirupa.com/t/using-as-to-change-whats-on-top/19338 "2003-04-26T22:30:10Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![tome](https://avatars.discourse-cdn.com/v4/letter/t/e56c9b/32.png) [@tome](https://forum.kirupa.com/u/tome)
#### Post date: [April 26, 2003, 10:30pm UTC](https://forum.kirupa.com/t/using-as-to-change-whats-on-top/19338/1 "2003-04-26T22:30:10Z")

</div>

I have three images which I want to switch back and forth when the user presses a button. I want a new image(imageB) to fade in on top of the current image(imageA) when the user pushes a button and then be able to go back the other way if they click another button(image A fading in over image B). Is there code which can bring something to the front or send it to the back.

thanks,  
tome

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 26, 2003, 10:31pm UTC](https://forum.kirupa.com/t/using-as-to-change-whats-on-top/19338/2 "2003-04-26T22:31:17Z")

</div>

if you want to simply bring objects to front/back, you can use the swapDepth method… for a fade-in/out effect, search the forums 🙂
