PDA

View Full Version : little FLASH question



Hysteria
31 Mar 2008, 11:24 AM
I have this script for a scroller
scroller_mc is a little block that I can drag to move block_mc:

scroller_mc.addEventListener(MouseEvent.MOUSE_DOWN, mouseDown);
function mouseDown(event:MouseEvent):void {
scroller_mc.startDrag(false, bounds);
}

scroller_mc.addEventListener(MouseEvent.MOUSE_MOVE, scrollFct);
function scrollFct(event:MouseEvent):void {
var moved:Number = scroller_mc.y - scrollUpper;
var pctMoved:Number = moved/scrollRange;
var blockMove:Number = pctMoved*blockRange;
block_mc.y = blockLower - blockMove;
}

scroller_mc.addEventListener(MouseEvent.MOUSE_UP, mouseReleased);
function mouseReleased(event:MouseEvent):void {
scroller_mc.stopDrag();
}

Everything works perfectly EXCEPT that I have to keep my mouse over scroller_mc so that the scrollFct and mouseReleased functions work. How can these two functions continue working even when my mouse is not over scroller_mc anymore??