Topic: Grab and drag scrolling

Can anyone offer assistance or provide an example/source for touch-based text scrolling on the Chumby?

Here's an example of what I'd like to achieve: http://www.chumby.com/guide/widget/Lib%C3%A9ration

Thanks!

2 (edited by gingerbeardman 2008-03-10 08:00:07)

Re: Grab and drag scrolling

on (press) use:
movieclip.startDrag

on (release) use:
movieclip.stopDrag

By looking at the difference in values _ymouse you can see how much was scrolled.

matt

Re: Grab and drag scrolling

Thanks, helped a bunch!

4 (edited by ApoXX 2008-03-13 11:43:39)

Re: Grab and drag scrolling

I was hoping to use the ansi scroller as a starting point but I can't figure out how to display dynamic text instead of an image.
The ansi scroller source is available here: http://www.chumby.com/guide/widget/ANSI%20Scroller

Any thoughts would be greatly appreciated as I have a new widget I'm about ready to release.

Edit: Nevermind, I got it working. wink

Re: Grab and drag scrolling

Thanks.. I need that too..

MyridoM

When someone annoys me, it takes 42 muscles in my face to frown...but it takes only 4 muscles to extend my arm and b**ch-slap you!
http://haunterofthenight.com/ * new blog location

6 (edited by ApoXX 2008-03-13 13:12:56)

Re: Grab and drag scrolling

I'll be posting the source to my widget at some point within the next few days. I had to tweak the ansiscroller code to work when the height of the text was less than the height of the screen, figure out some embedded font issues, and setup offsets for my interface.

If you want to play around with it now, the easiest way to get a "proof of concept" working is to download the original ansiscroller.fla and replace the following:

proxy = attachMovie....

with something similar to:

var format = new TextFormat();
format.align = "left";
format.font = "Arial";
format.size = 14;

var proxy = this.createEmptyMovieClip("proxy", 1);
var details = proxy.createTextField("details", 2, 0, 0, 320, 240);
proxy.details.type = "dynamic";
proxy.details.multiline = true;
proxy.details.selectable = false;
proxy.details.wordWrap = true;
proxy.details.html = true;
proxy.details.autoSize = true;
proxy.details.variable = "htmlContent";
proxy.details.htmlText = "<b>Testing 1 2 3</b><br>afafalkfja<br>askafldjadfs<br>adfasfdasfA<br>asdfafaf<br>asdfadasdf<br>asdfafaf<br>adsfasdf<br>adsfafasd<br>asfasfasf<br>asdfasfasf<br>asdfasfdasf<br>asdfafasdf<br>Asdfafasdf<br>Asdfafasfsaf<br>asdfasfdasfa<Br>Asdfasfasf<br>afdaf";
proxy.details.setTextFormat(format);

Re: Grab and drag scrolling

Thanks for this

Re: Grab and drag scrolling

I've posted the sources to the Package Tracker widget here: http://www.cyphergate.com/package-tracker.zip

Re: Grab and drag scrolling

Can you talk me through, in plain english, how this drag scroll works?

do I have to set up my movie a particular way? thanks!