# Transition on function button

**URL:** https://forum.kirupa.com/t/transition-on-function-button/63181
**Category:** flash
**Created:** [September 3, 2004, 4:09pm UTC](https://forum.kirupa.com/t/transition-on-function-button/63181 "2004-09-03T16:09:55Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![anthonyp](https://avatars.discourse-cdn.com/v4/letter/a/f04885/32.png) [@anthonyp](https://forum.kirupa.com/u/anthonyp)
#### Post date: [September 3, 2004, 4:09pm UTC](https://forum.kirupa.com/t/transition-on-function-button/63181/1 "2004-09-03T16:09:55Z")

</div>

Hi!

I’m having a problem making a transition movie play out.

I currently have this code which ties in to a button call “b1”

Although it calls both movies to load and play the woobrook.swf only play in and not out.

I am pretty sure these “if” statements need sorting out.

b1.onRelease = function() {  
if (\_root.section != “flash/portfolio text/woodbrook.swf”) {  
\_root.section = “flash/portfolio text/woodbrook.swf”;  
\_root.change.gotoAndPlay(“getrid”);

// Transition section (If no movie has been loaded etc)

if (level10.boxMovie == undefined) {  
level10.boxMovie = “flash/portfolio text/woodbox”;  
preview.loadMovie(“flash/portfolio text/woodbox.swf”);

} else if (level10.boxMovie != “flash/portfolio text/woodbox”) {

// Transition section (If a movie has been played up to stop then carry in out on release etc).

if (preview.\_currentframe \>= preview.midframe) {  
level10.boxMovie = “flash/portfolio text/woodbox”;  
preview.play();  
}  
}  
}  
};

Many thanks for your help in advance.

Anthony
