# This.onrelease targeting another scene

**URL:** <https://forum.kirupa.com/t/this-onrelease-targeting-another-scene/304617>\
**Category:** Uncategorized\
**Created:** [February 10, 2010, 9:26pm UTC](https://forum.kirupa.com/t/this-onrelease-targeting-another-scene/304617 "2010-02-10T21:26:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rserge](https://avatars.discourse-cdn.com/v4/letter/r/dc4da7/32.png) [@rserge](https://forum.kirupa.com/u/rserge)\
**Post date:** [February 10, 2010, 9:26pm UTC](https://forum.kirupa.com/t/this-onrelease-targeting-another-scene/304617/1 "2010-02-10T21:26:42Z")

</div>

Tryin to get the this.onrelease to link to another scene.  
This code below applied to a button that moved to another frame on the same scene, hence \_root  
In a redesign that button needs to link to another scene.  
I was thinking it would be  
this.onRelease = function(){  
gotoAndStop(“vignettes”, 1);  
}  
But did not work.  
The code below…

//all this code is inside the complex button so you can stick as many as you want  
//on the stage and all will work… they all will have this code in it…

stop(); // stop the movie clip from playing (stop button from growing, we want that when the mouse rolls over only

this.onEnterFrame = function(){  
if(rewind == true){ //if rewind switch is set to true play backwards  
prevFrame(); // play backwards  
}  
}

this.onRollOver = function(){  
rewind = false; //set variable (or switch) that decides wether ot not to play backwards…  
play(); // play this movie clip… (grow the button(tween));  
}

this.onRollOut = function(){  
rewind = true; //set or rewind switch to true so it will play backwards…  
}

this.onRelease = function(){  
\_root.gotoAndStop(2);  
}
