Code:
[B]function scroll(){[/B]
var moved:Number = scrollerblue_mc.y - scrollUpper;
var pctMoved:Number = moved/scrollRange;
var textMove:Number = pctMoved*textRange;
text_mc.y = textLower - textMove;
}
I would like to apply this function to an MC. I am attempting to make a scrollbar in AS3 (Flash CS4).
This is how I attempted to use it:
Code:
function myMcClick(e:MouseEvent):void
{
scrollerblue_mc.startDrag(false, rectangle);
[B]scrollerblue_mc.scroll;[/B]
stage.addEventListener(MouseEvent.MOUSE_UP, myMcClickUp);
stage.addEventListener(MouseEvent.MOUSE_MOVE, dragMyObject);
}
The scroll bar functions well; it is set within its boundaries and will scroll up and down as delegated. My problem is that I can't get my text to scroll with it. Unfortunately, I am not used to actionscript 3 and this would be so easy if I could just use this.onMouseMove
Anyone know where I'm going wrong?
Last edited: