3 Replies Latest reply on Aug 9, 2010 5:14 PM by danpeleg

    HSlider missing event?

    danpeleg

      I'm using HSlider events: thumbPress & thmbRelease,

      But there is another option of moving along the slider,

      by clicking the slider somwhere...

       

      There is no event to catch this?

      if there is what is it please?

        • 1. Re: HSlider missing event?
          ShardulSingh Level 3

          Hi,

           

          You are missing the change event.

           

          MainApplication

           

          <?xml version="1.0"?>
          <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
              <mx:Script>
                  <![CDATA[
                      import mx.controls.Alert;
                      private function onChange():void
                      {
                          Alert.show("Working fine....");
                      }
                  ]]>
              </mx:Script>
              <mx:VBox>
                  <mx:HSlider
                      maximum="100" change="onChange()"/>
              </mx:VBox>
          </mx:Application>

           

           

           

           

           

          Pls let me know if you have any issue.

           

           

           

           

          with Regards,

           

          Shardul Singh Bartwal

          • 2. Re: HSlider missing event?
            danpeleg Level 1

            Not really i tried that event...

            it runs everytime the slider changes his value..

             

            even when im using the thumb and i made my slider move along with a movie so it calls the change event all the time...

             

            there is another event or method that i can use?

            • 3. Re: HSlider missing event?
              danpeleg Level 1

              UPDATE:

               

              I have a slider, with those thumb events:

               

              [CODE]

              protected function slider_thumbPress():void

              {

                   player.pauseVideo();

              }

               

              private function slider_thumbRelease():void

              {

                   player.seekTo(Math.floor(slider.value), true);

                   player.playVideo();

              }

              [/CODE]

               

              Now this events only occure when you click the thumb, but i want the movie to move also when you click somewhere on the slider.

              so i used this event:

               

              [CODE]

              protected function slider_mouseDownHandler(event:MouseEvent):void

              {

                   player.pauseVideo();

                   var posX:Number = event.localX;

                   var totalX:Number = 430;

                   var dur:Number = player.getDuration();

                   player.seekTo(Math.floor((posX / totalX) * dur), true);

                   player.playVideo();

              }

              [/CODE]

               

              Now they are conflicting each other...

              There is a way to fix it?