4 Replies Latest reply on May 14, 2010 7:04 AM by TeotiGraphix

    Global Scroll policy




      Is it possible to set the scroll policies for all controls globally? or do I have to set them individually for each control?



        • 1. Re: Global Scroll policy
          puddytat5000 Level 1

          Hi, any ideas on this?

          • 2. Re: Global Scroll policy
            BhaskerChari Level 4

            You need to set individually for all components there is no other way I guess..




            Bhasker Chari

            1 person found this helpful
            • 3. Re: Global Scroll policy
              TeotiGraphix Level 3



              Each control is it's own instance, so there is no way to set them all at once globally.


              You could however listen to the main application's Event.ADDED since it bubbles and check the type of each instance. If it's a container, set the scroll policy for it. In a way this might be global.


              <?xml version="1.0" encoding="utf-8"?>
              <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
                          import mx.core.Container;
                          import mx.core.ScrollPolicy;
                          protected function application_addedHandler(event:Event):void
                              var container:Container = event.target as Container;
                              if (event.target is Container)
                                  trace("Container " + event.target.id);
                                  container.verticalScrollPolicy = ScrollPolicy.OFF;
                  <mx:VBox id="container1">
                      <mx:VBox id="container2">


              You could do the same thing with Groups etc.



              1 person found this helpful
              • 4. Re: Global Scroll policy
                TeotiGraphix Level 3

                sorry duplicate post