2 Replies Latest reply on Oct 21, 2009 2:57 PM by Seglespaan

    combo box with v-slider inside?




      can anyone tell me if this is possible, I want to create a text size control, the off state is to look like a combo box displaying the current size, but when the user clicks it I want a slider to appear so that they can then control the size of the text using the slider?


      Is this possible?





        • 1. Re: combo box with v-slider inside?
          Andrew Rosewarn Level 3

          Hi there


          Certainly is, probably want a custom component there.  Here's a really quick example which needs tidying up.  I;ve just used the popupbutton which looks like a combo and a custom canvas with a vslider in it and bound up the property.


          Main App


          <?xml version="1.0" encoding="utf-8"?>

          <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">



          [Bindable] private var pop:PopUPSlider = new PopUPSlider()




          <mx:PopUpButton x="420" y="23" label="{pop.fontSize}" popUp="{pop}"/>




          Custom Comp


          <?xml version="1.0" encoding="utf-8"?>

          <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="34" height="88" borderStyle="solid" backgroundColor="#FFFFFF">



          [Bindable] private var _fontSize:int;



          public function set fontSize(value:int):void {

          _fontSize = value;



          public function get fontSize():int {

          return _fontSize;



          private function setFontSize():void {

          fontSize = vslide.value;





          <mx:VSlider x="8" y="4" height="76" id="vslide" minimum="10" maximum="18" snapInterval="2" liveDragging="true" change="setFontSize()"/>



          Hope this helps




          • 2. Re: combo box with v-slider inside?
            Seglespaan Level 1

            exactly what I'm after, Thanks loads! Worked a treat!