# Trying to make movie play frame x to frame y then switch to frame Z

**URL:** <https://forum.kirupa.com/t/trying-to-make-movie-play-frame-x-to-frame-y-then-switch-to-frame-z/244718>\
**Category:** Uncategorized\
**Created:** [November 21, 2007, 5:12am UTC](https://forum.kirupa.com/t/trying-to-make-movie-play-frame-x-to-frame-y-then-switch-to-frame-z/244718 "2007-11-21T05:12:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![damainman](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@damainman](https://forum.kirupa.com/u/damainman)\
**Post date:** [November 21, 2007, 5:12am UTC](https://forum.kirupa.com/t/trying-to-make-movie-play-frame-x-to-frame-y-then-switch-to-frame-z/244718/1 "2007-11-21T05:12:28Z")

</div>

Hello,

I was hoping someone could help me out with an issue I’m having. I have my flash on multiple scenes, and would like to play an animation when clicking on the navigation button before switching to a different scene.

I’m halfway to accomplishing this.

Here is what i used

```auto

_root.gotoAndPlay("changepage1");
_root.onEnterFrame=function(){
if(this._currentframe=="changepage2"){
gotoAndPlay("Home2",1);
}

}

```

The above code is on a blank keyframe. Changepage1 is the start of the animation and Changepage2 is the end of the animation.

Upon clicking the navigation button it plays the above scenes.

However it doesn’t change scenes to scene “Home2”.

Thank you in advance for all your replies.
