# Problem With Playing Movieclip Backwards In Flash

**URL:** <https://forum.kirupa.com/t/problem-with-playing-movieclip-backwards-in-flash/310662>\
**Category:** Uncategorized\
**Created:** [June 16, 2010, 2:29am UTC](https://forum.kirupa.com/t/problem-with-playing-movieclip-backwards-in-flash/310662 "2010-06-16T02:29:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![LondonGuy76](https://avatars.discourse-cdn.com/v4/letter/l/dec6dc/32.png) [@LondonGuy76](https://forum.kirupa.com/u/LondonGuy76)\
**Post date:** [June 16, 2010, 2:29am UTC](https://forum.kirupa.com/t/problem-with-playing-movieclip-backwards-in-flash/310662/1 "2010-06-16T02:29:44Z")

</div>

Hi,

I’m re-designing my website in Flash CS4. There will be 6 buttons when it is finished. I have created 6 movieclips that fades in the text when you click on each button. What I’m trying to do is make the movieclip play backwards when a different button is clicked so the text fades back out before the new text fades in. I think I’ve nearly got it. I googled the effect and found the below action script. I’ve put it on the first button to see if it works, but I get the error messages at the bottom. Can anyone help?

WelcomeButton.onRelease = function() {  
startRewind (29);  
};  
function rewindMovieClip (targetFrame) {  
var currentPosition = mcLoader.\_currentframe;  
var targetPosition = targetFrame;  
var frameDiff = currentPosition - targetPosition;  
if (frameDiff \> 0) {  
mcLoader.prevFrame();  
}  
else {  
clearInterval (intervalID);  
}  
}  
function startRewind (targetFrame) {  
var docFPS = 12;  
var mySpeed = 1000/12  
intervalID = setInterval (rewindMovieClip, mySpeed, targetFrame);  
loader.loadMovie(“WelcomeText.swf”);  
}

I keep getting these error messages:

Scene=Scene 1, layer=Welcome, frame=142, Line 1 - Statement must appear within on handler
