8 Replies Latest reply on Dec 2, 2010 2:14 AM by alamata

    disable the mousewheel scrolling on mx:HTML

    alamata Level 1

      hey,...

       

      is it possible to disable the mousewheel scrolling on a <mx:HTML>

       

       

      enable="false" and  mouseEnabled="false" dont work,...

       

      thanks,...

        • 1. Re: disable the mousewheel scrolling on mx:HTML
          Flex harUI Adobe Employee

          Maybe set the mx:HTML to its content size so there isn't anything to scroll

          • 2. Re: disable the mousewheel scrolling on mx:HTML
            alamata Level 1

            in my case is not really a solution, ...

            because i desire to display only a part of the web page

            and i dont want that the user can scrolling in the complete web page,...

             

            i dont know if  there is  a solution?

            • 3. Re: disable the mousewheel scrolling on mx:HTML
              Flex Rock Level 1

              Hey,

               

               

              You can try this,

              Just rise the mousewheel event in html tag,

               

              See the example,

               

              public function doWheelMouse(event:MouseEvent):void
                          {
                              event.stopImmediatePropagation();
                          }

               

              <mx:HTML id="htmlUrl" location="http://www.adobe.com" mouseWheel="doWheelMouse(event)">
              </mx:HTML>

               

               

              Thanks

              Jayagopal.

              • 4. Re: disable the mousewheel scrolling on mx:HTML
                alamata Level 1

                hey,...

                 

                thanks for your intervention,...

                 

                i have try your solution,

                 

                but

                the scroll continue when i m on the mx:html

                • 5. Re: disable the mousewheel scrolling on mx:HTML
                  Flex Rock Level 1

                  Hey,

                   

                       If you don't mind can you post your code.

                   

                  Thanks

                  Jayagopal.

                  • 6. Re: disable the mousewheel scrolling on mx:HTML
                    alamata Level 1

                    here is the concerned part of the code,...

                     

                     

                     

                            public function doWheelMouse(event:MouseEvent):void
                                {
                                    event.stopImmediatePropagation();
                                }

                     

                                protected function YTsite_mouseDownHandler(event:MouseEvent):void
                                {
                                    event.stopImmediatePropagation()
                                }

                     

                     

                     

                    ////////////////////////////////////////////////////////////////////////////

                     

                     

                     

                        <mx:HTML id="YTsite"  visible="true"
                               
                                 locationChange="htmlLocationChange()" htmlRender="htmlLocationComplete()"
                                 verticalScrollPolicy="off"  borderColor="white" borderVisible="true" 
                                 paintsDefaultBackground="false"  horizontalScrollPolicy="off"
                                 x.stateY="10" y.stateY="424" width.stateY="585" height.stateY="532"
                        
                                 mouseWheel="doWheelMouse(event)" mouseDown="YTsite_mouseDownHandler(event)"/>

                    • 7. Re: disable the mousewheel scrolling on mx:HTML
                      Flex Rock Level 1

                      Hey,

                       

                                You place the HTML loader inside a canvas. Then it will work for you.Don't set width and height for html loader .Set width and height for canvas.

                      No need for mouse down event.

                       

                      <mx:Canvas width="50%" height="50%">

                       

                       

                      <mx:HTML id="YTsite"  visible="true" 
                                 
                                   locationChange="htmlLocationChange()" htmlRender="htmlLocationComplete()"
                                   verticalScrollPolicy="off"  borderColor="white" borderVisible="true" 
                                   paintsDefaultBackground="false"  horizontalScrollPolicy="off"
                                   x.stateY="10" y.stateY="424" mouseWheel="doWheelMouse(event)"/>
                      </mx:Canvas>

                       

                      Thanks,

                       

                      Jayagopal.

                      • 8. Re: disable the mousewheel scrolling on mx:HTML
                        alamata Level 1

                        it is OK now,...

                         

                        Thanks a lot for your Solution,...

                         

                        thanks for  your comprehension,...