qnx.ui.slider.VolumeSlider

VolumeSlider

Properties | Methods | Events | Examples


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.



Class information:
PlayBook Tablet OS Version:   1.0.6

View the examples

See also

Slider



Public Properties

 PropertyDefined By
 Inheritedactive : Boolean
Gets or sets the active property of the Slider.
Slider
  audioBoostEnabled : Boolean
Enables AudioBoost visuals on the VolumeSlider.
VolumeSlider
 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
  maxUnboostedAudioLevel : Number
The maximum value the VolumeSlider can go to when audioBoostEnabled is set to true.
VolumeSlider
 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
  value : Number
[override] Gets or sets the current value of the slider.
VolumeSlider

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 = all, 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
  
setAudioBoostFillSkin(skin:Object):void
Sets the audio boost fill skin for the slider.
VolumeSlider
  
setAudioBoostTrackSkin(skin:Object):void
Sets the audio boost skin for the track of the slider.
VolumeSlider
  
setBoostDivider(skin:Object):void
Sets the skin for the audio boost divider.
VolumeSlider
 Inherited
setFillSkin(skin:Object):void
Sets the fill skin for the slider.
Slider
  
setMuteIcon(skin:Object):void
Sets the skin for the mute icon.
VolumeSlider
 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
  
setVolumeIcon(skin:Object):void
Sets the skin for the volume icon.
VolumeSlider

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
  
[override]
VolumeSlider
 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
  
[override]
VolumeSlider
 Inherited
validate(property:String = all):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

Property Detail

audioBoostEnabled


audioBoostEnabled:Boolean

Enables AudioBoost visuals on the VolumeSlider.


Implementation

public function get audioBoostEnabled():Boolean
public function set audioBoostEnabled(value:Boolean):void

maxUnboostedAudioLevel


maxUnboostedAudioLevel:Number

The maximum value the VolumeSlider can go to when audioBoostEnabled is set to true.


Implementation

public function get maxUnboostedAudioLevel():Number
public function set maxUnboostedAudioLevel(value:Number):void

value


value:Number
[override]

Gets or sets the current value of the slider. The value is represented by the position of the thumb on the slider track.

Setting this property will cause the thumb to update its position. This value is updated as the user drags the slider thumb. The fill is updated in the volume slider to show the user whether the volume is boosted or not boosted.

The value is constrained to be within the minimum and maximum values.

The default value is 0.


Implementation

public function get value():Number
public function set value(value:Number):void

Constructor Detail

VolumeSlider()


public function VolumeSlider()

Creates a VolumeSlider instance.

Method Detail

drawChildren()


override protected function drawChildren():void

setAudioBoostFillSkin()


public function setAudioBoostFillSkin(skin:Object):void

Sets the audio boost fill skin for the slider. The audio boost fill skin is the area of the track to the left of the slider thumb button (in a horizontal slider) that represents the current value of the slider when the value of the slider is past the maxUnboostedAudioLevel.

You can pass in a qualified class name String, or the actual class. In either instance the class that is used must implement the ISkin interface.

Note: Do not pass in an instance of a skin class. This may cause unexpected behavior.

Parameters

skin:Object — The fill skin to set.

setAudioBoostTrackSkin()


public function setAudioBoostTrackSkin(skin:Object):void

Sets the audio boost skin for the track of the slider. The audio boost track is the vertical or horizontal line that the thumb button moves along when audio boost is enabled.

You can pass in a qualified class name String, or the actual class. In either instance the class that is used must implement the ISkin interface.

Note: Do not pass in an instance of a skin class. This may cause unexpected behavior.

Parameters

skin:Object — The track skin to set.

setBoostDivider()


public function setBoostDivider(skin:Object):void

Sets the skin for the audio boost divider. The audio boost divider is appears above the fill and below the thumb and marks where the audio boost begins. The divider should have the same dimensions as the track.

You can pass in a qualified class name String, or the actual class. In either instance the class that is used must implement the ISkin interface.

Note: Do not pass in an instance of a skin class. This may cause unexpected behavior.

Parameters

skin:Object — boost divider skin to set.

setMuteIcon()


public function setMuteIcon(skin:Object):void

Sets the skin for the mute icon. The mute icon is the icon that appears to the left of the slider when the value of the slider is 0. The icon does not appear when showVolumeIcon is false.

You can pass in a qualified class name String, or the actual class. In either instance the class that is used must implement the ISkin interface.

Note: Do not pass in an instance of a skin class. This may cause unexpected behavior.

Parameters

skin:Object — The mute icon skin to set.

setVolumeIcon()


public function setVolumeIcon(skin:Object):void

Sets the skin for the volume icon. The volume icon is the icon that appears to the left of the slider when the value of the slider is greater than 0, and less than or equal to maxUnboostedAudioLevel when audioBoostEnabled is true. The icon does not appear when showVolumeIcon is false.

You can pass in a qualified class name String, or the actual class. In either instance the class that is used must implement the ISkin interface.

Note: Do not pass in an instance of a skin class. This may cause unexpected behavior.

Parameters

skin:Object — The volume icon skin to set.

updateSkins()


override protected function updateSkins():void

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 );
        }
    }
}