Skip navigation
Currently Being Moderated

When does the horizontalScrollBar get created on a List?

May 4, 2012 5:01 PM

Tags: #list #scrollbar #flex4

When does the horizontalScrollBar get created on a List?

The scroller is created, but the scrollbar isn't created yet and I get an error:

 

I have a spark List:

 

<s:List id="list" creationComplete="creationCompleteHandler(event)">

        <s:layout>

            <s:HorizontalLayout  />

        </s:layout>

</s:List>

 

private function creationCompleteHandler(event:FlexEvent):void {

     (event.currentTarget as List).scroller.addEventListener( FlexEvent.UPDATE_COMPLETE, onScrollerComplete );

// these don't trigger anything!

//    (event.currentTarget as List).scroller.addEventListener(FlexEvent.CREATION_COMPLETE , onScrollerComplete );

//    (event.currentTarget as List).scroller.addEventListener(Event.ADDED_TO_STAGE , onScrollerComplete );

}

private function onScrollerComplete(event:Event):void {

     // horizontalScrollBar still null at this point - how can I use it?   

     // I want to set the style, but it's not created yet!

     // event.currentTarget.scroller.horizontalScrollBar.setStyle("repeatInte rval", 600);

}

 

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points