You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Justin Mclean <ju...@classsoftware.com> on 2017/02/28 07:28:22 UTC

[FlexJS] listening for scroll events

Hi,

I have a container with a ScrollingViewport. How do you listen to scroll events on teh content?

As far asI can see the scale event don't bubble and because of the added containers on the JS side you need to do something ugly like this:

this["positioner"].children[0].addEventListener("scroll", contentScrolled, false);

Is there a butter way? 

Is ScrollingViewport missing a scroll handler on it that you can assign to a method?

Thanks,
Justin


Re: [FlexJS] listening for scroll events

Posted by Alex Harui <ah...@adobe.com>.

On 2/27/17, 11:28 PM, "Justin Mclean" <ju...@classsoftware.com> wrote:

>Hi,
>
>I have a container with a ScrollingViewport. How do you listen to scroll
>events on teh content?
>
>As far asI can see the scale event don't bubble and because of the added
>containers on the JS side you need to do something ugly like this:
>
>this["positioner"].children[0].addEventListener("scroll",
>contentScrolled, false);
>
>Is there a butter way?

I don't know about a "butter" way, but if we can get you and others to
understand PAYG, DAYG (because no example so far has needed those events),
and that we want to encapsulate common patterns, then hopefully folks will
see that the answer may be to create a ScrollingViewportWithEvents and
that dispatches the events you are looking for.  Then we'll all be
"jammin'" ;-)

Thanks,
-Alex