# Make button play few frames from one movie before another

**URL:** https://forum.kirupa.com/t/make-button-play-few-frames-from-one-movie-before-another/169583
**Category:** Uncategorized
**Created:** [November 17, 2005, 1:27pm UTC](https://forum.kirupa.com/t/make-button-play-few-frames-from-one-movie-before-another/169583 "2005-11-17T13:27:08Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![will\_roberts](https://avatars.discourse-cdn.com/v4/letter/w/4da419/32.png) [@will\_roberts](https://forum.kirupa.com/u/will_roberts)
#### Post date: [November 17, 2005, 1:27pm UTC](https://forum.kirupa.com/t/make-button-play-few-frames-from-one-movie-before-another/169583/1 "2005-11-17T13:27:08Z")

</div>

Hi all,

I think this is a hard one for you 🙂

I have my buttons done and each button loads a movie into my main movie.

Now what i want is for my button to play the last few frames of one movie before auto opening a new one so…

Say i was on my main screen and i clicked “contact” this would then start my animation for the contact page and stop when the page is fully on screen now what i want is when i click “portfolio” for instance it will play the last few frames of the current movie it is showing first hen load up the portfolio (The last few frames will be a closing of the contact page)

Contact button is as follows

```auto

stop(); 
  
this.onEnterFrame = function(){ 
if(rewind == true){ 
prevFrame(); 
} 
} 
  
this.onRollOver = function(){ 
rewind = false;
play(); 
} 
  
this.onRollOut = function(){ 
rewind = true; 
} 
this.onRelease = function(){if (_root.mainbox_MC._currentFrame >=1 && _root.mainbox_MC._currentFrame !=6){
				_root.mainbox_MC.gotoAndPlay(2);}
		else if (_root.mainbox_MC._currentFrame == 30){
				_root.mainbox_MC.stop();}

```

Portfolio button code is

```auto

 
stop(); 
  
this.onEnterFrame = function(){ 
if(rewind == true){ 
prevFrame(); 
} 
} 
  
this.onRollOver = function(){ 
rewind = false;
play(); 
} 
  
this.onRollOut = function(){ 
rewind = true; 
} 
this.onRelease = function(){if (_root.portfolio_MC._currentFrame >=1 && _root.portfolio_MC._currentFrame !=6){
				_root.portfolio_MC.gotoAndPlay(2);}
		else if (_root.portfolio_MC._currentFrame == 30){
				_root.portfolio_MC.stop();}

```

Any help would be greatly appreciated
