MyDNA
April 4, 2006, 9:26am
1
Hello
i used the files from the scrollbar tutorial and added and changed some code to add easing (that code i found somewhere on this forum) That works fine.
But now…
I found a file on ffiles.com wich loads news dynamicly from a xml file.
i added it. And it works fine till you start scrolling. It never reaches the bottom of the news.
Can someone help me out with it?
My file is ready to download from here… http://www.dri360.com/dynamic_news.zip
the code where i’m talking about is on frame13 of nieuws.fla
muchos gracias :azn:
Thanks :p:
MyDNA
April 4, 2006, 8:13pm
2
This is the AS code from frame 13:
scrolling = function (easing)
{
var moveSpeed:Number = 20;
var easingSpeed:Number = 10;
var scrollHeight:Number = scrollTrack._height;
var contentHeight:Number = contentMain._height;
var scrollFaceHeight:Number = scrollFace._height;
var maskHeight:Number = maskedView._height;
var initPosition:Number = scrollFace._y = scrollTrack._y;
var initContentPos:Number = contentMain._y;
var finalContentPos:Number = maskHeight - contentHeight + initContentPos;
var left:Number = scrollTrack._x;
var top:Number = scrollTrack._y;
var right:Number = scrollTrack._x;
var bottom:Number = scrollTrack._height - scrollFaceHeight + scrollTrack._y;
var dy:Number = 0;
var speed:Number = 20;
var moveVal:Number = (contentHeight + maskHeight) / (scrollHeight - scrollFaceHeight);
scrollFace.onPress = function ()
{
var currPos:Number = this._y;
startDrag (this, false, left, top, right, bottom);
this.onMouseMove = function ()
{
dy = Math.abs (initPosition - this._y);
contentMain.newY = Math.round (dy * -1 * moveVal + initContentPos);
};
};
contentMain.onEnterFrame = function ()
{
if (!easing || easing == undefined)
{
this._y = this.newY;
}
else
{
this._y += (this.newY - this._y) / easingSpeed;
}
};
scrollFace.onMouseUp = function ()
{
stopDrag ();
delete this.onMouseMove;
};
if (contentHeight < maskHeight)
{
scrollFace._visible = true;
}
else
{
scrollFace._visible = false;
}
};
scrolling (true);