Get Scrolled position from ScrollEvent : Event « Event « Flex






Get Scrolled position from ScrollEvent

Get Scrolled position from ScrollEvent
           

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
  
  <mx:Script>
    
      import mx.events.ScrollEvent;
      [Bindable]
      private var scrollPos:Number;
      
      private function scrollHandler(event:ScrollEvent):void
      {
        scrollPos = event.position;
      }
  
  </mx:Script>
  
  <mx:Label id="scrollLabel" fontSize="18" fontWeight="bold" text="Current scroll position: {scrollPos}"/>
  <mx:HScrollBar id="myScrollBar" width="300" minScrollPosition="0" maxScrollPosition="300" pageSize="100" scroll="scrollHandler(event)"/>
  
</mx:Application>

   
    
    
    
    
    
    
    
    
    
    
  








Related examples in the same category

1.Stop event propagationStop event propagation
2.Hold down the Shift key while pressing the mouse buttonHold down the Shift key while pressing the mouse button
3.Set the value of the errorString property to create an error tipSet the value of the errorString property to create an error tip
4.Nested inner functionNested inner function
5.Submit button callSubmit button call
6.Add a new button when the user presses an existing buttonAdd a new button when the user presses an existing button
7.Manually dispatch an event in an MXML tagManually dispatch an event in an MXML tag
8.UI Control initialization eventUI Control initialization event
9.Add ActionScript code in the component's definition for initialize eventAdd ActionScript code in the component's definition for initialize event
10.Use dispatchEvent() method to dispatch any eventUse dispatchEvent() method to dispatch any event
11.Dispatch an event in an MXML tagDispatch an event in an MXML tag
12.Create new event from ActionScriptCreate new event from ActionScript
13.Single event property accessSingle event property access
14.Add loading complete event for URLLoader
15.Create Complete event and initialize eventCreate Complete event and initialize event
16.Cast event sender to UI controlCast event sender to UI control
17.Module loading eventModule loading event
18.Using error event when loading ModuleUsing error event when loading Module
19.Handling Events InlineHandling Events Inline
20.Use Event BubblingUse Event Bubbling
21.Bind getter function to phoneNumberChanged eventBind getter function to phoneNumberChanged event
22.NonCommittingChangeEvent DemoNonCommittingChangeEvent Demo
23.NonCommittingChange Event SampleNonCommittingChange Event Sample
24.StartUp event OrderStartUp event Order
25.Event With FunctionEvent With Function
26.Event BubblingEvent Bubbling
27.Set HTMLText With Initialize eventSet HTMLText With Initialize event
28.Change EventChange Event
29.Using change event to recognize that a new item was entered into the prompt, and adds it to the data providerUsing change event to recognize that a new item was entered into the prompt, and adds it to the data provider
30.Edit Event Prevents EditEdit Event Prevents Edit