Take the 2-minute tour ×

First of all I know there is a spark VolumeBar component but, for design requirements I can't use it..

I'm trying to create a custom component but heights are not responding as should


This is were I call the class

<components:VolumeSlider steps="4" height="100" />

The problem is that the volume slider is adapting perfectly, but My custom items component doesn't.

<s:HGroup width="100%" height="100%" maxHeight="{height}" >
        <s:VGroup width="100%" height="100%" paddingBottom="20" paddingTop="20">
            <s:VSlider id="slider" width="100%" height="100%" maximum="{_steps-1}" />

        <s:VGroup id="items" width="100%" height="100%" />

            import mx.events.FlexEvent;

            private var _steps:uint = 10;

            public function set steps( value:uint ):void
                _steps = value;

                if ( items != null && items.numChildren != 0 )


            private function create():void
                for ( var i:uint = 0; i < _steps; ++i )
                    var item:VolumeSliderItem = new VolumeSliderItem();
                    item.percentHeight = item.percentWidth = 100;
                    if ( items != null )items.addElement(item );


where VolumeSliderItem is a spark button

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

I don't see any call to create(). I added 'creationComplete="create()"' on the Application tag, and then it created 10 sliders to the VGroup with id 'items'. Is that what you're looking for?

share|improve this answer
is inside set steps... –  Mc- Feb 24 '10 at 18:03
But the 'steps' setter doesn't get called in your code, so neither does create(). –  99miles Feb 25 '10 at 2:06
Yes, I just updated the question to add a little more information. I'm trying createChildren, updateDisplayList... but i didn't find it yet. –  Mc- Feb 25 '10 at 10:43
So, am I correct in assuming that that block of code is in a component file called 'VolumeSlider'? If so, can you show the whole thing including the root tag? –  99miles Feb 25 '10 at 16:19
add comment

Your Answer


