Old 31-03-2008, 10:50   #1 (permalink)
Hysteria
Registered User
 
Join Date: Feb 2008
Posts: 17
little question

I have this script for a scroller
scroller_mc is a little block that I can drag to move block_mc:
Code:
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??
  Reply With Quote
Old 01-04-2008, 04:35   #2 (permalink)
appleeatsorange
Pitfall II - Lost Caverns
 
appleeatsorange's Avatar
 
Join Date: Jan 2008
Location: UK
Posts: 63
Sorry I cannot help you with this one - I would try to find a script online which is similar to what you need and take a look at the code - maybe then you will be able to work out the specific lines in question...?
  Reply With Quote
Old 01-04-2008, 10:13   #3 (permalink)
Hysteria
Registered User
 
Join Date: Feb 2008
Posts: 17
I actually found the problem...
just added this:
scroller_mc.addEventListener(MouseEvent.MOUSE_OUT, mouseReleased);

now when my cursor isn't over scroller_mc, everything stops.
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8