semi working flash movie: http://198.104.154.25/
here is my fla: http://198.104.154.25/scroller.fla
OK this is the most perplexing action script problem i have ever had. i am
desperately trying to solve this problem. my scroller works, but goes up too
far, and does not act correctly. if someone can point me in the right
direction, i will be VERY happy. the whole entire script is contained within
the main movie. there are no frames. just the clips, thats all.

// ----------------
// scroller.fla
// [EMAIL PROTECTED]
// ----------------
// function to scroll any movieclip, based on soome input variables
    // myScrollable - movieclip to scroll
    // myMask - mask to be used for the scrollable movieclip
    // myScrollbar - scrollbar movieclip
    // myGutter - 'gutter' or bounding box for the scrollbar
    // a - speed for the scroller
    // d - damping for the scroller after being released
    // targY - new _y position for the scrollable movieclip
// --------------------

function justScrollIt(myScrollable:MovieClip, myMask:MovieClip,
myScrollbar:MovieClip, myGutter:MovieClip, a:Number, d:Number, targY:Number)
{
    // ------------------------------
    myYspeed = myScrollable._y;
    myScrollbar.useHandCursor = false;
    // the 'gutter' or bounding box which the scrollbar resides in
    // next version, 'myGutter' will be the bounding box, and these vars
will be grabbed from there
    gutterLeft = myScrollbar._x;
    gutterTop = 0;
    //gutterTop = myGutter._y - (myGutter._height/2) +
(myScrollbar._height/2);
    gutterRight = myScrollbar._x;
    gutterBottom = myGutter._y + (myGutter._height/2) -
(myScrollbar._height/2);
    // ------------------------------
    myScrollbar.onPress = function(){
        startDrag(myScrollbar, false, gutterLeft, gutterTop, gutterRight,
gutterBottom);
    }
    //stop the drag
    myScrollbar.onRelease = REF.scrollbar_mc.onReleaseOutside = function() {
        stopDrag();
    }
    // ------------------------------
    //set the mask for the text
    myScrollable.setMask(myMask);
    // ------------------------------
    myScrollable.onEnterFrame = function(){
        scrollAmount = (myScrollable._height -
(myMask._height/1.3))/(myMask._height - myScrollbar._height);
        //set a new target y position
        targY =- myScrollbar._y * scrollAmount;
        myYspeed = ((Math.round(myScrollable._y) -
Math.round(targY))/a+Math.round(myYspeed))/d;

        myScrollable._y -= myYspeed;
    }
    // ------------------------------
}


// call the scroller function
justScrollIt(scrollable_mc, mask_mc, scrollbar_mc, gutter_mc, 8, 8, 0);

-----------------
regards,
-edward hotchkiss
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to