Topic: help with hscroll

I'm working on a widget where I need to scroll text that's wider than the screen, "marquee-style". I'm doing this by altering the hscroll of the textfield. This works great in a browser, but doesn't appear to work correctly on my Chumby. I'm watching for when the text has scrolled enough by watching its hscroll, then resetting it when it scrolls its width.

The behavior I'm seeing is that the hscroll value is being changed (i'm updating another text field with it's current hscroll to help me debug), but the actual display is not keeping up with the hscroll value. This causes the scroll to "reset" before the field is visibly scrolled the correct amount. It just scrolls a small percentage of the distance. I've tried scrolling by a greater number of pixels each time, but that doesn't help.

Is this the best way to handle this? I'm new to Flash and am having trouble sussing out the cause of the issue.

Re: help with hscroll

Yeah, hscroll seems to work differently in Flash Lite than it does in desktop Flash.

I'm not sure if that's intentional - I'll put together an example to send up to Adobe and see what they have to say.

Re: help with hscroll

how are you watching the text? with an onEnterFrame event or setInterval?

4 (edited by ih8gates 2007-12-07 06:14:18)

Re: help with hscroll

i'm having the same function that sets the hscroll put the value in a visible textfield.

my code looks like this (scroller is a function that gets attached to movieclips that contain a title_text textfield.

_root.titleScrollingSpeed is set elsewhere.

function scroller(target_mc) {
    
    
        if(target_mc.title_txt.textWidth > target_mc.title_txt._width) {
            target_mc.title_txt.hscroll += _root.titleScrollingSpeed;
            trace(target_mc.title_txt.hscroll);
            debug.text = target_mc.title_txt.hscroll + " - " + target_mc.textScrollWidth;
        }
    
        if(target_mc.title_txt.hscroll >= target_mc.textScrollWidth) {
            target_mc.title_txt.hscroll = 0;
        }

}

just fyi... as a hack, the function that values the textfiled checks to see if it's gonnna be too long. if it is, it gets concatenated to itself ala:

target_mc.text += " " + target_mc.text; // double it up. (hack)

Re: help with hscroll

Duane wrote:

Yeah, hscroll seems to work differently in Flash Lite than it does in desktop Flash.

I'm not sure if that's intentional - I'll put together an example to send up to Adobe and see what they have to say.

great. incidentally, if they do come up with an update for Flash Lite, that change wouldn't make it to Chumby until the next firmware update, correct?

Re: help with hscroll

Correct.

At the moment, the code drop from Adobe for Flash Lite is designed for Symbian or Windows Mobile, and we port it to Linux and include the specific support for the chumby device (sensors, etc).  This takes a couple of weeks to create and run through a full QA cycle, depending upon what they've changed, and what we've added.

Over the history of Chumby Industries, we've done the Flash Lite port seven times.

Re: help with hscroll

Duane wrote:

Yeah, hscroll seems to work differently in Flash Lite than it does in desktop Flash.

I'm not sure if that's intentional - I'll put together an example to send up to Adobe and see what they have to say.

Just an FYI: As of today's update (1.5.0) hscroll is still broken.

Duane - if you have the ear of anyone on the Flash Lite team, it'd be great if they'd squash this bug and make hscroll work consistently with Flash desktop versions.