Tweening Movieclips

Hello everyone…I’m trying to change some great code cbeech authored for me a while ago. I’m just trying to change the code to use Tweenlite and to make it that so I fully know how to edit the code, thus make it modular for me. Right now the code uses the flash tween classes. I rather use Tweenlite.

So, basically what the code does is tween a movieclip on its X axis. Thus, when a button is pressed, the corresponding movieclip tweens out to the right and the other one tweens in from the left simulataneously. But I need to code to be completely modular, in case i want to do the same thing o n the Y axis, or if I need to add some more properties to the tween.

Here’s the code cbeech crafted, which is great but I’m not skilled enough, yet, to edit to fit all of my circumstances:

import fl.transitions.;
import fl.transitions.easing.
;

var index:int = 1;
var buttons = [ ];

page1.x = 0;

for(var i=1; i<7; i++)
{
this[‘page’+i+‘Btn’].id = i;
buttons.push(this[‘page’+i+‘Btn’]);
if(i != index)
{
this[‘page’+i+‘Btn’].buttonMode = true;
this[‘page’+i+‘Btn’].addEventListener(MouseEvent.ROLL_OVER, onRollover);
this[‘page’+i+‘Btn’].addEventListener(MouseEvent.CLICK, buttonClicked);
}else{
this[‘page’+i+‘Btn’].gotoAndPlay(‘open’);
this[‘page’+i+‘Btn’].removeEventListener(MouseEvent.ROLL_OVER, onRollover);
}
}

function onReady(btn:MovieClip):void
{
btn.addEventListener(MouseEvent.ROLL_OVER, onRollover);
}

function onRollover(e:MouseEvent):void
{
e.target.gotoAndPlay(‘open’);
e.target.removeEventListener(MouseEvent.ROLL_OVER, onRollover);
e.target.addEventListener(MouseEvent.ROLL_OUT, onRollout);
}

function onRollout(e:MouseEvent):void
{
e.target.gotoAndPlay(‘close’);
e.target.removeEventListener(MouseEvent.ROLL_OUT, onRollout);
}

function buttonClicked (e:MouseEvent):void
{
for(var b=0; b<buttons.length; b++)
{
if(index == b+1)
{
if(buttons**.currentLabel == ‘open’)
buttons**.gotoAndPlay(‘close’);
buttons**.addEventListener(MouseEvent.CLICK, buttonClicked);
buttons**.buttonMode = true;
}

    if(e.currentTarget.id == b+1) 
    {
        e.currentTarget.removeEventListener(MouseEvent.ROLL_OUT, onRollout);
        e.currentTarget.removeEventListener(MouseEvent.CLICK, buttonClicked);
        e.currentTarget.buttonMode = false;
    }
}
nextPage(e.currentTarget.id);

}

function nextPage(n:int):void
{
var aOUT = new Tween(this[‘page’+index], “x”, Regular.easeOut, 1, 0, 1, true);
var tOUT = new Tween(this[‘page’+index], “x”, Regular.easeOut, this[‘page’+index].x, stage.stageWidth, 1, true);

index = n;
var aIN = new Tween(this['page'+index], "x", Regular.easeOut, 0, 1, 1, true);
var tIN = new Tween(this['page'+index], "x", Regular.easeOut, 0 - this['page'+index].width, 0, 1, true);

}

And now here is what I started with; need help just adding some vars :

stop();

import gs.TweenMax;
import gs.TweenLite;
import gs.easing.;
import gs.plugins.
;
TweenPlugin.activate([FrameLabelPlugin]);

var exitStage:;
var lastClicked:
;

clipOne.addEventListener(MouseEvent.CLICK, clipOneMover,false,0,true);
clipTwo.addEventListener(MouseEvent.CLICK, clipTwoMover,false,0,true);

function exitStage ():void
{
lastClicked=exitStage;
TweenMax.to(exitStage, 1, {x:1000});
}

function clipOneMover (event:MouseEvent):void
{
lastClicked=event.target.name;
TweenMax.to(clipOne, 1, {x:0});
exitStage();
}

function clipTwoMover (event:MouseEvent):void
{
lastClicked=event.target.name;
TweenMax.to(clipTwo, 1, {x:0});
exitStage();
}

Thanks for any help…I need help creating the right vars to move the Movieclip off the stage when I clicked a button to tween a new movieclip onto the stage…my main plan is to make this code modular and simple enough for me to edit the x y or z, or even the scale properties…cbeech code is awesome, but I’m not skilled to edit it to fit all of my needs…thanks to cbeech for the code…

I attached a zip file…

thanks for any time…I’m very well grateful…

I attac

x lisa x