If else statement the way to go?


I have two movie clips. One is called btn1 and the other mc1.

Currently when I rollover btn1, mc1 moves 100.0 pixels from it’s current position. When I rollout, mc1 moves back to it’s original position. That’s fine.

What I want to do is when I rollover btn1 and then CLICK btn1, I want mc1 to remain at the 100.0 position.

I thinking this must be an if else statement, but I’m unclear about how to write the code. Below you’ll find the code that I have so far:

//set movie clip position

pan1 = mc1._x;

//code to control the easing of the movie clip

MovieClip.prototype.easeX = function(tX) {
this.onEnterFrame = function() {
this._x = tX-(tX-this._x)/1.2;
if (this._x >= tX-1 && this._x <= tX+1) {
delete this.onEnterFrame;


btn1.onRollOver = function() {



btn1.onRollOut = function() {


//release. I don’t know what to do with this part.

btn1.onRelease = function() {


Thanks to everyone who has made my actionscript learning less painful.