Skip navigation
Currently Being Moderated

Flex Hslide help

May 23, 2012 8:28 AM

Hi,

 

Need help with this:

 

I want the slide value in an Variable I can use other place in program. The slide have the value 0-100.

 

Code:

 

      

protected function hslide_changeHandler(event:Event):void

                    {

                           I need the value in a variable here...

                          

                    }

 

Thanks for any help!

 
Replies
  • Currently Being Moderated
    May 23, 2012 8:38 AM   in reply to fsoender

    Did you try

     

    someVariable = event.target.value;

     
    |
    Mark as:
  • Currently Being Moderated
    May 23, 2012 10:59 AM   in reply to fsoender

    try this

     

    someVariable = HSlider(event.target).value;

     

    You may want to listen to the changeEnd event instead of the change event. The change event will continuously fire as the user is moving the slider.

    The changeEnd event fires when they are done moving the slider.

     
    |
    Mark as:
  • Currently Being Moderated
    May 23, 2012 1:08 PM   in reply to fsoender

    What is the error you get with HSlider(event.target).value; ?

    what is the type of the variable to which you are assigning the value?

     
    |
    Mark as:
  • Currently Being Moderated
    May 23, 2012 1:56 PM   in reply to fsoender

    If you want the current value selected by the user with the hslide you

     

    // declare your variable as a 'Number' because HSlider.value is a Number...

    public var newValue:Number;

     

    // inside your event handler, assign the current Value of your HSlider to the variable...

    newValue = HSlider(event.target).value;

     

    Your problem may have been the variable type all along.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points