Skip to main content
Craig Grummitt
Inspiring
January 30, 2008
Question

vertical slider

  • January 30, 2008
  • 7 replies
  • 858 views
anyone else noticed any problems with the Slider component? If i specify horizontal, and change the minimum from 0 to anything else, the slider button goes off the slider. anyone found a workaround by chance? (other than write a custom slider component, which would be pretty straightforward admittedly!)
This topic has been closed for replies.

7 replies

Craig Grummitt
Inspiring
February 1, 2008
yeah i found the same issue with re-exporting the SWC.

ah well. no need to go too deep or lose any sleep over this one. call me a renegade, but i'm just going to fudge it:

i've dropped the idea of vertical sliding and gone with horizontal. as abeall mentioned, i could equally have just rotated the slider(and rotate the thumb skins if they weren't sitting right)

i placed an invisible rectangle 13x13 in each thumb skin to prevent my thumb from resizing.(which works so long as my custom thumb is smaller than 13x13!)

obviously ideally we'd resolve this slider code, but with time short i think i'll leave it for gskinner!
Damon Edwards
Inspiring
February 1, 2008
LOL, good catch! Hadn't gotten to that problem yet! Even after changing some values and re-exporting a new SWC, it's not "updating". It is, but, its breaking... Which I find odd.. I modified the FLVPlayback component to dispatch NetStatusEvents, exported a new SWC, and it works great... Not sure why this isn't compiling correctly... I must get some shut eye, but I'll be back on this in the morning if there hasn't been a break through. :)
Damon Edwards
Inspiring
February 1, 2008
lol, right abeall, that is exactly where i'm looking right now! Something doesn't seem right there. I'm investigating as we speak!
Craig Grummitt
Inspiring
February 1, 2008
i like your take a look under the hood attitudes!
re my thumb resizing problem i notice a size hard-coded on line 803 of Slider.as:
thumb.setSize(13, 13);
i suspect that might be my problem!
February 1, 2008
This is probably the problem area, line 663 in Slider.as;

thumb.x = ((_direction == SliderDirection.VERTICAL) ? (maximum-minimum-value) : (value-minimum))/(maximum-minimum)*(_width);

The part that isn't working is (maximum-minimum-value). It certainly doesn't look right. I would expect something more like:

(value-minimum))/(maximum-minimum)*(_height)

But I don't know what _width is or where it comes from, or if there is actually a _height.

I don't have time to compile and test right now, but that's the first place I'd start. HTH
Damon Edwards
Inspiring
February 1, 2008
That is odd. You can try having a look at the base classes, tinkering then export a new SWC to get a new component. I will have to do this when I get more time. Path--

C:\Program Files\Adobe\Adobe Flash CS3\en\Configuration\Component Source\ActionScript 3.0\User Interface\fl\controls\Slider.as

and

C:\Program Files\Adobe\Adobe Flash CS3\en\Configuration\Component Source\ActionScript 3.0\User Interface\fl\core\UIComponent.as

are the two you are probably interested in.
Damon Edwards
Inspiring
February 1, 2008
lol @ #4. I'll have to check this out when I get home.
Damon Edwards
Inspiring
January 31, 2008
Hey Craig, I'm not seeing the problem you are describing. Any chance we can see an example file?
Craig Grummitt
Inspiring
January 31, 2008
Sorry did i say horizontal? i meant vertical.

Steps to recreate:
1. drag Slider component onto stage.
2. change direction to 'vertical'
3. change minimum to 5.
4. run out, observe strange behaviour and scratch head...

February 1, 2008
I was able to reproduce. That's disappointing. It appears that any minimum value on a vertical slider offsets the start point.

I guess you could use a horizontal slider and just rotate it 90 degrees.

You might also contact the folks at gskinner.com, they made the V3 components. It's probably a small, easy, fix if you know where to look.