onRelease issue

Ok I have made a scroll pane (with lots of help from fluid_0ne and Claudio :)) which is almost done except for 1 issue. Sometimes, when I am dragging the bar up and down, it gets stuck or something. The onRelease command never executes for some reason. No matter where you drag the mouse or whether you are holding the button down it keeps scrolling. I can’t figure out what is causing it. It’s not consistent either, it seems sorta random. Most of the time it doesn’t happen. Should I just add a on DragOut or something to fix it? I don’t really want to because it makes it harder to scroll when you have to keep it over the bar the whole time.

use onRelease AND onReleaseOutside

ahh. ok will try it. How do I do it syntax wise?

this.onRelease || this.onReleaseOutide= function()

(I’m a C++er in case you couldnt tell :))

I had a slightly parallel situation when I was trying to do a rollOver with a button. It was more consistent, but it’s worth a shot trying. If I waved the cursor over my button just right (and usually just fast enough) it would think that I was going on the button multiple times.

I fixed it by adding a boolean value which I set to false (representing if it was over the button) IF it was false, then I would do the appropriate stuff and also set that variable to true (meaning it was currently ON the button). Then, in the roll off function, I checked to make sure I only did stuff if that variable was true, to make sure it wasn’t somehow going off the button multiple times (even if it was only over the button once). And i did the appropriate stuff, including setting that booleean value back to false (meaning it was not on the button now).

I made that wordy so you could see everything I did. I think you may be able to sort of adopt that idea into your scrolling. Because it seems like that may be a possible thing that would appear random, but work sometimes with the same type of fiddling that I did with mine.

Ok so it was just sorta like a double check. A Boolean to verify whether it was over or not. I can do that without too much trouble.

off topic
|| is a logical AND in C++? && is the logical AND in action script and Java and pretty much a lot of other highend prog lanuages. :slight_smile:

Its an OR not an AND. In this case, it could do either one to terminate the drag so I thought or would work. The AND operator is still &&.

Yeah i know.

Senocular said: use onRelease AND onReleaseOutside

You said: ahh. ok will try it. How do I do it syntax wise?

this.onRelease || this.onReleaseOutide= function()

(I’m a C++er in case you couldnt tell)

So i thought you had got mixed up. Sorry.

this.onRelease = this.onReleaseOutide= function()

you had your = turned 90 degrees :stuck_out_tongue:

:slight_smile: Gotcha. Thanks guys (and/or girls)

Yup. That did it. Thanks again everyone. Now i’ve got a pretty nifty scrollbar. It even works.