Created
February 4, 2011 23:45
-
-
Save srohde/812030 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" | |
xmlns:s="library://ns.adobe.com/flex/spark" | |
xmlns:mx="library://ns.adobe.com/flex/mx" | |
applicationComplete="applicationCompleteHandler(event)"> | |
<fx:Script> | |
<![CDATA[ | |
import mx.collections.ArrayCollection; | |
import mx.collections.IList; | |
import mx.events.FlexEvent; | |
import mx.events.PropertyChangeEvent; | |
[Bindable] | |
private var dp : IList; | |
protected function applicationCompleteHandler( event : FlexEvent ) : void { | |
var a : Array = []; | |
var count : int = 0; | |
while ( ++count <= 100 ) { | |
a.push( "Foo " + count ); | |
} | |
dp = new ArrayCollection( a ); | |
} | |
protected function list_creationCompleteHandler( event : FlexEvent ) : void { | |
// Does not work with mouse wheel or arrow buttons due to bug http://bugs.adobe.com/jira/browse/SDK-26533 | |
/* list.scroller.verticalScrollBar.addEventListener( Event.CHANGE, verticalScrollBarChangeHandler ); */ | |
list.scroller.viewport.addEventListener( PropertyChangeEvent.PROPERTY_CHANGE, propertyChangeHandler ); | |
} | |
protected function propertyChangeHandler( event : PropertyChangeEvent ) : void { | |
if ( event.property == "verticalScrollPosition" ) { | |
if ( event.newValue == ( event.currentTarget.measuredHeight - event.currentTarget.height )) { | |
trace( "scrolled to end" ); | |
} | |
} | |
} | |
]]> | |
</fx:Script> | |
<s:List id="list" | |
height="100%" | |
creationComplete="list_creationCompleteHandler(event)" | |
dataProvider="{dp}"/> | |
</s:WindowedApplication> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment