Forums > Javascript

scrolling in bpatcher

May 17, 2009 | 8:25 pm

Hi I´m quite a newbie to javascript,So please bare with me.
There is probably a very simple answer on how to do this but I can´t seem to get my head around it..
I need to control the v.scrolling in a bpatcher (in presentation mode) the bpatcher object have the attribute "Enable vertical scrollbar"enabled.(for showing the v.scroll) It scrolls in my main patch, but not in the bpatcher. I use the following script:

autowatch = 1;
inlets = 1;

function msg_int(a)
{
if (inlet == 0)
{
this.patcher.wind.scrollto(0,a);
}
}

I know the bpatcher argument is box, but I can´t get this to work either or how do I apply it?
I´ve attached a test patch, with bpatcher and script for explaining what I´m trying to do.
Does someone has a solution or idea for me?
Any help is much appreciated!


May 17, 2009 | 8:32 pm

You should be able to do this with the "offset" attribute to [bpatcher] instead of using wind.scrollto() in a javascript.

lh


May 18, 2009 | 9:45 am

Thank you both!
the offset atttribute, of course I overlooked that one..


Viewing 3 posts - 1 through 3 (of 3 total)