1 Reply Latest reply on Apr 4, 2011 5:58 AM by Tanu Jain

    Detect when something is added to a canvas

    luke3design!!

      Hi!

       

      I have a canvas which I add some List to.

      The List components are arranged horizontally.

      I set the horizontalscrollpolicy of the canvs to on, so when a List components exceed the boundaries of the canvas the horizontal scroll bar is displayed.

       

      What I'm trying to achieve is to let the horizontal scrollbar scroll to the maximumHorizontalScrollPosition so the last added List component it's not hided but displayed without the user to scroll right to see it.

       

      What i would need is having an event dispatched when the new List Component is added and drawed to the canvas so I can set scroll bar.

       

       

      At this moment i use an eventListener for FlexEvent.UPDATE_COMPLETE to set the scrollbar to the maximum horizontal scroll position. The problem is that this event is also dispatched when the user manually move the scroll bar, so any manual scroll attempt is frustred by this event listener. :-(

       

       

      Do you know if there is some kind of Event which is fired when something is added and completely drawed into a canvas?

      It would be of great help to listen for this event and then moving the scrollbar

       

      Thank you!

      Luke