Tween function in classes

Hi there!

I’m a newbie and I’ve got a questions. I’m working on a project witch I want to archieve by putting all actionscript in classes. I found al little script on to make my content change on the y position and de menu stays always on the right side of the website.

This is the code:

// importeer alle classes die je nodig hebt
import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;

// zet alle pagina's op de juiste plek (check op de timeline) 
var feet150X:Number = 0;
var feet150Y:Number = 0;

var feet200X:Number = 0;
var feet200Y:Number = -768;

var feet250X:Number = 0;
var feet250Y:Number = -1536;

// Creeer variabelen
var xTween:Tween;
var yTween:Tween;
var inTween:Tween;
var outTween:Tween;

// Bepaal welke tween je gebruikt voor het overgaan van de pagina's
xTween = new Tween(main_mc,"x",Strong.easeInOut,main_mc.x,feet150X,2,true);
yTween = new Tween(main_mc,"y",Strong.easeInOut,main_mc.y,feet150Y,2,true);

// Bepaal de alpha van het infaden en uitfaden van de content
inTween = new Tween(main_mc.feet150_mc,"alpha",None.easeNone,1,1,.5,true);
outTween = new Tween(main_mc.feet150_mc,"alpha",None.easeNone,1,1,.5,true);

// Creeer een eventlistener voor het in en uit faden van de content

// Creeer een eventlistener zodat de buttons klikbaar worden
feet150_btn.addEventListener(MouseEvent.CLICK, navigate);
feet200_btn.addEventListener(MouseEvent.CLICK, navigate);
feet250_btn.addEventListener(MouseEvent.CLICK, navigate);

// functie voor de buttons
function navigate(event:MouseEvent):void
	if( == feet150_btn)
	else if( == feet200_btn)

// reset alle functies
function setTween(tweenX:Number,tweenY:Number,tweenMC:MovieClip):void
	xTween.begin = main_mc.x;
	yTween.begin = main_mc.y;
	xTween.finish = tweenX;
	yTween.finish = tweenY;
	tweenMC.alpha = 0;
	inTween.obj = tweenMC;

function fadeIn(event:TweenEvent):void
	outTween.obj = inTween.obj;

function fadeOut(event:TweenEvent):void


Now I’m trying to put the whole code in classes but that’s not working. I’ve made a eventlistener for mouseEvent, but I don’t how to get the y position tween in the class.

Begin of my class:

package esmee.classes
	import flash.display.*;
	import fl.transitions.*;
	import fl.transitions.easing.*;
	public class TestButton extends MovieClip
		private var _origXScale:Number;
		private var _origYScale:Number;
		var main:MovieClip;
		public function TestButton()
			_origXScale = this.scaleX;
			_origYScale = this.scaleY;

			this.buttonMode = true;
			this.addEventListener(MouseEvent.ROLL_OVER, over);
			this.addEventListener(MouseEvent.ROLL_OUT, out);
			this.addEventListener(MouseEvent.CLICK, onClick);
		private function over(event:MouseEvent):void
			this.scaleX *= 1.1;
			this.scaleY *= 1.1;
			trace ("Functie ROLL_OVER");
		private function out(event:MouseEvent):void
			this.scaleX = _origXScale;
			this.scaleY = _origYScale;
			trace ("Functie ROLL_OUT");
		private function onClick(event:MouseEvent):void
			trace ("Functie onClick")	
			if (name == "button_mc1")
					trace ("button_mc1");
					// Code for y-position of the website
			else if (name == "button_mc2")
					trace ("button_mc2");

Any help will be appreciated. Thanks.