Packageqnx.ui.slider
Classpublic class VolumeSlider
InheritanceVolumeSlider Inheritance Slider Inheritance UIComponent Inheritance flash.display.MovieClip

The VolumeSlider component provides the functionality for implementing a volume control.

The VolumeSlider component is fundamentally similar to the Slider component except that it implemements a customized look and feel:

A volume slider control.

View the examples

See also

Slider


Public Properties
 PropertyDefined By
 Inheritedactive : Boolean
Gets or sets the active property of the Slider.
Slider
 Inheritedcontainment : String
Gets or sets a property that determines how a component is contained within a parent container.
UIComponent
 Inheritedmaximum : Number
Gets or sets the maximum value of the slider.
Slider
 Inheritedminimum : Number
Gets or sets the minimum value of the slider.
Slider
 Inheritedsize : Number
Gets or sets the size for this component (as a percentage of the container's size, or in pixels).
UIComponent
 InheritedsizeMode : String
Gets or sets the size mode for this component.
UIComponent
 InheritedsizeUnit : String
Gets or sets the unit of measure for the size property.
UIComponent
 Inheritedvalue : Number
Gets or sets the current value of the slider.
Slider
Public Methods
 MethodDefined By
  
Creates a VolumeSlider instance.
VolumeSlider
 Inherited
destroy():void
Call this method when you want to have your object collected by the garbage collector.
UIComponent
 Inherited
drawNow():void
Calls the draw() method.
UIComponent
 Inherited
invalidate(property:String, invalidateNow:Boolean = false):void
Marks the property as invalid and the draw() method is called on the next frame or the next render, whichever comes first.
UIComponent
 Inherited
setFillSkin(skin:Object):void
Sets the fill skin for the slider.
Slider
 Inherited
setPosition(x:Number, y:Number):void
Sets the x and y position of the component.
UIComponent
 Inherited
setSize(w:Number, h:Number):void
Sets the width and height of the component.
UIComponent
 Inherited
setThumbSkin(skin:Object):void
Sets the skin for the slider thumb button.
Slider
 Inherited
setTrackSkin(skin:Object):void
Sets the skin for the track of the slider.
Slider
Protected Methods
 MethodDefined By
 Inherited
callLater(method:Function):void
Calls the specified method on the next frame or the next render, which ever happens first.
UIComponent
 Inherited
createInstance(linkage:Object):DisplayObject
Calling this method will attempt to create a DisplayObject instance based on the value of the linkage parameter.
UIComponent
 Inherited
draw():void
Called every time you set the width and height of the component.
UIComponent
 Inherited
isInvalid(property:String, ... properties):Boolean
Checks to see if the property is invalid and returns true if it is.
UIComponent
 Inherited
onAdded():void
Called when the instance is added to the stage.
UIComponent
 Inherited
onRemoved():void
Called when the instance is removed from the stage.
UIComponent
 Inherited
setEnabled(val:Boolean):void
Called when the enabled property changes.
UIComponent
 Inherited
validate(property:String):void
Lets the component know that the specified property has been validated.
UIComponent
Events
 Event Summary Defined By
 Inherited Dispatched when a drag event ends.Slider
 Inherited Dispatched when a drag event starts.Slider
 Inherited Dispatched when the slider is moved by the user.Slider
Constructor Detail
VolumeSlider()Constructor
public function VolumeSlider()

Creates a VolumeSlider instance.

Examples
In the following example, a VolumeSlider instance is created and added to the stage. Event listeners are added to listen for slider movement events.
     
package
{
    import flash.display.Sprite;
    
    import qnx.ui.events.SliderEvent;
    import qnx.ui.slider.VolumeSlider;
    
    [SWF(height="600", width="1024", frameRate="30",
     backgroundColor="#FFFFFF")]
    public class sliderSample extends Sprite
    {
        
        private var myVSlider:VolumeSlider;
        
        public function sliderSample()
        {
            initializeUI();
        }
        
        private function initializeUI():void
        {
            myVSlider =  new VolumeSlider();
            myVSlider.setPosition(300, 300);
            myVSlider.minimum = 0;
            myVSlider.maximum = 100;
            myVSlider.value = 50;
            // listen to the when the slider moves
            myVSlider.addEventListener( SliderEvent.MOVE, sliderChange );
            // listen to the when the slider starts to move
            myVSlider.addEventListener( SliderEvent.START, sliderStart );
            // listen to the end of the slider event
            myVSlider.addEventListener( SliderEvent.END, sliderStop );
            this.addChild( myVSlider );
        }
        
        private function sliderChange( event:SliderEvent ) : void
        {
            var newlevel:int = Math.round( event.target.value );
            trace( "slider value: ", newlevel );
        }
        
        private function sliderStart( event:SliderEvent ) : void
        {
            var newlevel:int = Math.round( event.target.value );
            trace( "started moving at: ", newlevel );
        }
        
        private function sliderStop( event:SliderEvent ) : void
        {
            var newlevel:int = Math.round( event.target.value );
            trace( "stopped moving at: ", newlevel );
        }
    }
}