qnx.fuse.ui.slider.VolumeSlider

VolumeSlider

Properties | Methods | Events | Examples


Packageqnx.fuse.ui.slider
Classpublic class VolumeSlider
InheritanceVolumeSlider Inheritance Slider Inheritance SliderBase 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 a value that determines whether the control is active and enabled.
Slider
  audioBoostEnabled : Boolean
Gets or sets a value that enables AudioBoost visuals on the VolumeSlider.
VolumeSlider
 InheritedexplicitHeight : Number
[read-only] Returns the explicit height (actual height, in pixels) of the UI component.
UIComponent
 InheritedexplicitWidth : Number
[read-only] Returns the explicit width (actual width, in pixels) of the UI component.
UIComponent
 InheritedincludeInLayout : Boolean
Specifies whether or not the component should be included in its parent container's layout.
UIComponent
 InheritedlayoutData : Object
Returns the layout data for the object.
UIComponent
 Inheritedmaximum : Number
Gets or sets the maximum value of the slider.
Slider
  maxUnboostedAudioLevel : Number
Gets or sets the maximum value of the VolumeSlider when audioBoostEnabled is set to true.
VolumeSlider
 InheritedminHeight : Number
Gets or sets the minimum preferred height of the control.
UIComponent
 Inheritedminimum : Number
Gets or sets the minimum value of the slider.
Slider
 InheritedminWidth : Number
Gets or sets the minimum preferred width of the control.
UIComponent
  showVolumeIcon : Boolean
[write-only]
VolumeSlider
  value : Number
[override]
VolumeSlider

Public Methods

 MethodDefined By
  
Creates a VolumeSlider instance.
VolumeSlider
 Inherited
childChanged(resizedChild:DisplayObject = null):Boolean
Notifies the UIComponent that one or more of its children has changed in a manner that may affect this object's layout.
UIComponent
 Inherited
destroy():void
Call this method when you want to have your object collected by the garbage collector.
UIComponent
 Inherited
Returns the size options for the given control.
UIComponent
 Inherited
Calling this method results in a call to the components validateDisplayList() method before the display list is rendered.
UIComponent
 Inherited
Calling this method results in a call to the components validateProperties() method before the display list is rendered.
UIComponent
 Inherited
measure(availableWidth:Number, availableHeight:Number):LayoutMeasurement
This method calls doMeasure() in order to calculate the preferred size of the control.
UIComponent
 Inherited
setActualSize(w:Number, h:Number):void
Sets the width and height of the object without setting the explicitWidth and explicitHeight.
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
 Inherited
setFillSkin(skin:Object):void
Sets the fill skin for the slider.
SliderBase
 Inherited
setLayoutBounds(bounds:Rectangle):void
Sets the receiver's size and location to the rectangular area specified by the arguments.
UIComponent
 Inherited
setPosition(x:Number, y:Number):void
Sets the x and y position of the component.
UIComponent
 Inherited
setThumbSkin(skin:Object):void
Sets the skin for the slider thumb button.
SliderBase
 Inherited
setTrackSkin(skin:Object):void
Sets the skin for the track of the slider.
SliderBase
 Inherited
Validates the display list of the component by calling the updateDisplayList().
UIComponent
 Inherited
Validates the component immediately by calling validateProperties(), validateSizes(), and validateDisplayList() if necessary.
UIComponent
 Inherited
Validates the properties of the component by calling the commitProperties() method.
UIComponent

Protected Methods

 MethodDefined By
 Inherited
Process properties of the component.
UIComponent
 Inherited
Process the state of the component.
UIComponent
 Inherited
createFill(linkage:Object):void
SliderBase
 Inherited
createThumb(linkage:Object):void
SliderBase
 Inherited
createTrack(linkage:Object):void
SliderBase
 Inherited
doMeasure(availableWidth:Number, availableHeight:Number):LayoutMeasurement
[override] Measures the size of the component so that it can be reported to the layout framework for laying the component out properly.
SliderBase
 Inherited
drawFill():void
Draws the fill of the slider.
SliderBase
  
flushCache():void
[override]
VolumeSlider
 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
Invalidates the parent's size and display list if includeInLayout property is set to true.
UIComponent
 Inherited
[override] Called when the position of the thumb on the x axis has changed.
Slider
 Inherited
[override] Called when the thumb has been pressed by the user.
Slider
 Inherited
[override] Called when the thumb has been released by the user.
Slider
 Inherited
[override] Called when the thumb has been pressed by the user.
Slider
 Inherited
updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
[override] Sets the size and position of the children of the component.
Slider

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

Gets or sets a value that enables AudioBoost visuals on the VolumeSlider. When set to true, the slider is allowed to travel to its maximum value. Otherwise, its maximum is clamped at maxUnboostedAudioLevel.


Implementation

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

maxUnboostedAudioLevel


maxUnboostedAudioLevel:Number

Gets or sets the maximum value of the VolumeSlider when audioBoostEnabled is set to true.


Implementation

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

showVolumeIcon


showVolumeIcon:Boolean  [write-only]


Implementation

public function set showVolumeIcon(value:Boolean):void

value


value:Number
[override]


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

flushCache()


override protected function flushCache():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.

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.fuse.ui.events.SliderEvent;
    import qnx.fuse.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 );
        }
    }
}