Snap Interval Problem in V Slider

14 views
Skip to first unread message

B.Praveen

unread,
Sep 12, 2011, 11:07:44 AM9/12/11
to Flex India Community
Hi Friends

I Have Canvas Which Contain The V slider, contain Snap interval Value
0.01;Snap Inter value

increment Like In The 0.01,0.02,0.03,0.04........;

But It Increment The Values Likes in the order 0.03,0.06 Every
time ;

How To Solve This Problem;

Please Check The Sample Code Here;


Am Getting The Problem The
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="horizontal">

<mx:Script>
<![CDATA[

public function chan(event)
{

}
]]>
</mx:Script>
<mx:Canvas width="200" height="400" backgroundColor="#A15353" x="0"
y="0">
<mx:VSlider x="0" y="0" id="vsd" liveDragging="true"
change="chan(event)" width="200" height="400" minimum="0.2"
maximum="13" snapInterval="0.01"/>
<mx:TextInput text="{vsd.values}" >
</mx:TextInput>
</mx:Canvas>

<mx:VSlider x="0" y="0" id="vsd11" liveDragging="true"
change="chan(event)" width="200" height="400" minimum="0.25"
maximum="13" snapInterval="0.01"/>
</mx:Application>

Suree

unread,
Sep 19, 2011, 2:35:49 AM9/19/11
to flex_...@googlegroups.com
Hi Praveen, 

I think the height of the slider is very less for snap interval of 0.01.I tried the same with a height of 1500 and tick interval of 0.05(just for reference) and able to achieve the snap interval of 0.01.

See the below calculations(These are purely my thoughts.Somebody please correct me if i am wrong)

Maximum = 13,snap interval = 0.01

So no of units should be 13/0.01 = 1300

Height of the control = 400

so height of each unit is = 400/1300 = 0.307

in other world for each pixel 1300/400 ~= 3.25 units should be dragged.

So in order to move the slider by one snap interval u need to move the solder by 0.03 pixels which is almost impossible by ur mouse movement.


Thanks
Suresh

Suree

unread,
Sep 19, 2011, 4:55:56 AM9/19/11
to flex_...@googlegroups.com

So in order to move the slider by one snap interval u need to move the solder by 0.03 pixels which is almost impossible by ur mouse movement.


Sorry its 0.3 pixels not 0.03,anyways moving mouse for 0.3 pixels also is tough.

BalthaPraveen Kumar

unread,
Sep 19, 2011, 5:00:01 AM9/19/11
to flex_...@googlegroups.com
Hi Suree ;

Tnx For  Given Idea [Or Suggestion] ; I Will Try it By Changing  Height of The Canvas;


B.Praveen


--
You received this message because you are subscribed to the Google Groups "Flex India Community" group.
To view this discussion on the web visit https://groups.google.com/d/msg/flex_india/-/yTegVI_F5uoJ.
To post to this group, send email to flex_...@googlegroups.com.
To unsubscribe from this group, send email to flex_india+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/flex_india?hl=en.



--
B.Praveen Kumar


Reply all
Reply to author
Forward
0 new messages