# If currently not on this frame, play this exit

**URL:** <https://forum.kirupa.com/t/if-currently-not-on-this-frame-play-this-exit/62803>\
**Category:** Uncategorized\
**Created:** [August 31, 2004, 1:00pm UTC](https://forum.kirupa.com/t/if-currently-not-on-this-frame-play-this-exit/62803 "2004-08-31T13:00:37Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mistdreamz](https://avatars.discourse-cdn.com/v4/letter/m/a8b319/32.png) [@mistdreamz](https://forum.kirupa.com/u/mistdreamz)\
**Post date:** [August 31, 2004, 1:00pm UTC](https://forum.kirupa.com/t/if-currently-not-on-this-frame-play-this-exit/62803/1 "2004-08-31T13:00:37Z")

</div>

hi, i’ve got a problem with my actionscripting part  
i want to create an “exit” effect just like many sites i’ve seen  
it goes somewhat like this structure:  
page 1:  
intro animation  
main page  
exit animation

```
          page 2:
          intro animation
          main page
          exit animation
          
          page 3:
          intro animation
          main page
          exit animation

```

ok, now there will be 3 buttons, to bring u to the respective pages.  
the prob is, how do i run the exit animation for the page i’m currently in, when i click on another button that doesnt not link to my current page?  
like e.g  
i’m in page 1  
when i click on page 3’s button, it will play page 1’s exit animation  
then it will play page 3’s intro animation  
i’m thinking of a code like

if (\_root.currentFrame != 1) {  
playThatFrame’sExitAnimation  
}

this will be placed on the button itself… i cant attach a .fla file as i have no idea how to do it… thanx in advance

---

<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:** [August 31, 2004, 1:45pm UTC](https://forum.kirupa.com/t/if-currently-not-on-this-frame-play-this-exit/62803/2 "2004-08-31T13:45:49Z")

</div>

[http://www.kirupa.com/developer/mx2004/transitions.htm](http://www.kirupa.com/developer/mx2004/transitions.htm)

Good tutorial on exactly how to do it!

---

<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:** [August 31, 2004, 2:04pm UTC](https://forum.kirupa.com/t/if-currently-not-on-this-frame-play-this-exit/62803/3 "2004-08-31T14:04:15Z")

</div>

ooh… overlooked that, sorry, cos im using mx, nv bothered much bout mx2004  
can that tut work for mx oso?

---

<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:** [September 1, 2004, 6:41am UTC](https://forum.kirupa.com/t/if-currently-not-on-this-frame-play-this-exit/62803/4 "2004-09-01T06:41:44Z")

</div>

hi again, i have followed the tutorial but it doesn’t seem to work  
i have attached the .fla, please rectify my error  
thanx in advance

---

<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:** [September 1, 2004, 9:21pm UTC](https://forum.kirupa.com/t/if-currently-not-on-this-frame-play-this-exit/62803/5 "2004-09-01T21:21:59Z")

</div>

problem solved 🙂 hope this helps. i commented it all. should be working fine.

---

<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:** [September 2, 2004, 7:11am UTC](https://forum.kirupa.com/t/if-currently-not-on-this-frame-play-this-exit/62803/6 "2004-09-02T07:11:20Z")

</div>

thanx, but it doesn’t really clarify completely my doubts.  
i think most prob its the part where the button’s sript has to check if the “page” is in the mid frame, then play the exit animation, where i have problems…  
the .fla u posted only showed how to load a movie, and check…  
can u explain with regards to my doubt?

thanx

---

<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:** [September 2, 2004, 3:36pm UTC](https://forum.kirupa.com/t/if-currently-not-on-this-frame-play-this-exit/62803/7 "2004-09-02T15:36:49Z")

</div>

there is no such thing as midframe.  
the equilvelant is:

```auto
this.midframe = this._totalframes/2;

```

hope this clarifies your query.
