Scrolling movie clip working-sorta

Hey all,

I have thumbs loaded via XML which scroll using a custom scroll movie clip.

The problem is that when i just click on the scroll movie clip, the thumbs “jump up” somewhat, then when I scroll (drag)down, the thumbs (contained within “main_container”) scroll beyond the mask until no thumbs are visible. When I drag back up, the thumbs scroll, but fall short of the first thumb by maybe three thumbs…

import caurina.transitions.Tweener;

var thumb_width:Number;
var thumb_height:Number;
var thumbs_x:Number;
var thumbs_y:Number;
var video_x:Number;
var video_y:Number;
var my_videos:XMLList;
var my_total:Number;


var main_container:Sprite;
var thumbs:Sprite;
var titles:Sprite;
var my_player:FLVPlayback;

var myXMLLoader:URLLoader = new URLLoader();
myXMLLoader.load (new URLRequest("playlist.xml"));
myXMLLoader.addEventListener (Event.COMPLETE, processXML);

function processXML (e:Event):void {
	var myXML:XML = new XML(e.target.data);

	thumb_width = [email protected]_WIDTH;
	thumb_height = [email protected]_HEIGHT;
	thumbs_x = [email protected]_X;
	thumbs_y = [email protected]_Y;
	video_x = [email protected]_X;
	video_y = [email protected]_Y;
	my_videos = myXML.VIDEO;
	my_total = my_videos.length();

	makeContainers ();
	callThumbs ();
	makePlayer ();
}

function makeContainers ():void {
	main_container = new Sprite();
	addChild (main_container);

	thumbs = new Sprite();
	thumbs.addEventListener (MouseEvent.CLICK, playVideo);
	thumbs.addEventListener (MouseEvent.MOUSE_OVER, onOver);
	thumbs.addEventListener (MouseEvent.MOUSE_OUT, onOut);
	thumbs.x = thumbs_x;
	thumbs.y = thumbs_y;
	thumbs.buttonMode = true;
	main_container.addChild (thumbs);
	
	titles = new Sprite();
	titles.x = thumbs_x;
	titles.y = thumbs_y;
	
	main_container.addChild (titles);
	main_container.mask=thumb_holder;
	main_container.x=track.x+13;
	main_container.y=track.y;
	trace("main_container height"+main_container.height);
	
}

function callThumbs ():void {
	trace ("main_container Y pos"+main_container.y);

	for (var i:Number = 0; i < my_total; i++) {
		var thumb_url = my_videos*[email protected];
		var thumb_loader = new Loader();
		thumb_loader.name = i;
		thumb_loader.load (new URLRequest(thumb_url));
		thumb_loader.contentLoaderInfo.addEventListener (Event.COMPLETE, thumbLoaded);
		thumb_loader.y = (thumb_height+10)*i;

		var thumb_title = my_videos*[email protected];
		var title_txt:TextField = new TextField();
		title_txt.text = thumb_title;
		title_txt.y = thumb_loader.y;
		title_txt.x = thumb_width + 10;
		title_txt.width = thumb_width;
		title_txt.height = thumb_height;
		title_txt.wordWrap = true;
		title_txt.textColor=0xffffff;
		titles.addChild (title_txt);


	}
}

function thumbLoaded (e:Event):void {
	var my_thumb:Loader = Loader(e.target.loader);
	thumbs.addChild (my_thumb);
}

function makePlayer ():void {
	my_player = new FLVPlayback();
	my_player.skin ="SkinOverPlaySeekMute.swf";
	my_player.skinBackgroundColor = 0xAEBEFB;
	my_player.skinBackgroundAlpha = 0.5;

	my_player.x = video_x;
	my_player.y = video_y;
	my_player.width = 480;
	my_player.height = 270;

	//main_container.addChild (my_player);
	stage.addChild (my_player);
	my_player.source = my_videos[0][email protected];
}

function playVideo (e:MouseEvent):void {
	var video_url = my_videos[e.target.name][email protected];
	my_player.source = video_url;
}

function onOver (e:MouseEvent):void {
	var my_thumb:Loader = Loader(e.target);
	my_thumb.alpha = 0.5;
}
function onOut (e:MouseEvent):void {
	var my_thumb:Loader = Loader (e.target);
	my_thumb.alpha = 1;
}



//Scroller//////////////////////////////////
var minScroll:Number = 0;
var maxScroll:Number = track.height-handler.height;
var draging:Boolean = false;
var bounds:Rectangle = new Rectangle(handler.x, handler.y, 0, maxScroll);
//var rect:Rectangle = new Rectangle(0,0,47,0);//x,y,width,height

handler.buttonMode = true;
handler.addEventListener(MouseEvent.MOUSE_DOWN,beginDrag);

function beginDrag(event:MouseEvent):void {
	handler.startDrag(false,bounds);
	draging = true;
	handler.addEventListener(Event.ENTER_FRAME,checkingProgress);
	stage.addEventListener(MouseEvent.MOUSE_UP,endDrag);
}
function endDrag(event:MouseEvent):void {
	handler.stopDrag();
	draging = false;
	trace ("main_container Y pos"+main_container.y);
}

//trace("my_total"+my_total);

function checkingProgress(event:Event):void {
	var percent:Number = handler.y/maxScroll;
	if (draging) {
		Tweener.addTween(main_container,{y:(-percent*(main_container.height-thumb_holder.height)),time:1});

	}
}

I believe the problem is here:

Tweener.addTween(main_container,{y:(-percent*(main_container.height-thumb_holder.height)),time:1});

Any help would be appreciated
Thanks
7