0 Replies - 1078 Views - Last Post: 28 January 2008 - 09:27 AM

#1 zjem  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 28-January 08

Scroller with easing script messed up

Post icon  Posted 28 January 2008 - 09:27 AM

Hi,
I downloaded a script for an easing scroller i want to customize to my site.
It appears my (longer)scrolling text scrolls out of sight as soon as the fla starts.
There's something wrong with the _y values. I have no clue how to fix this.

I attached the fla.

As i'm near desperation i would appreciate any help!

There's a movieclip on my main timeline containing one frame with:
A layer with a scrollslider (called dragger) (movieclip)
A mask layer, mask is called "theMask" (movieclip)
A layer with the scoll text called textScroller (movieclip)

And an actionslayer containing this script:
//set a variable
targY=0;
//set the x position of the dragger
dragger._x=650;
//set the drag action of the dragger
//drag is restricted to the height of the mask
dragger.onPress=function(){
startDrag(this,false,this._x,0,this._x,theMask._height-this._height);
}
//stop the drag
dragger.onRelease=dragger.onReleaseOutside=function(){
stopDrag();
}

//set the mask for the text
theText.setMask(theMask);
//the scrolling animation
theText.onEnterFrame=function(){
/*set a variable
this variable basically stores info regarding what fraction of the total text
is being displayed through the mask and ensures that dragging the dragger
from top to bottom will reveal all the text.
this allows you to change the amount of text and the scroller will update itself
*/
scrollAmount=(this._height-(theMask._height/1.3))/(theMask._height-dragger._height);
//set a new target y position
targY=-dragger._y*scrollAmount;
//set the y of the text to 1/5 of the distance between its current y and the target y

//change the 5 to a lower number for faster scrolling or a higher number for slower scrolling
this._y-=(this._y-targY)/5;

Attached File(s)



Is This A Good Question/Topic? 0
  • +

Page 1 of 1