He Wayne,

I just noticed you replied. I am afraid this doesn't solve my problem.

In your code both inputs have snap-intervalls, and both set the value
to eachother.

The problem arises when you have a normal text-input, not a numeric
stepper. We don't want a stepper, because we wan't the user to be as
precise as he wants.

You change the text-input, it changes the slider, which is rounded to
nearest value in its interval, and then it changes the text-input to
the new value..

I want the slider to be in the area, but then do not want it to
broadcast a change. So it broadcasts its change only when it was
slided, not when the value was set from the other input....

Thanks

--- In [email protected], "wayneposner" <[EMAIL PROTECTED]> wrote:
>
> I think you're trying to do something I just did.
> 
> Add the following mxml lines to your component (just change the 
> values as necessary):
> 
> <mx:NumericStepper id="resultStepper" focusOut="updateSlider()" 
> value="100" change="updateSlider()"   maximum="1000" minimum="0" 
> stepSize="10" textAlign="left" x="168" y="18" height="25"/>
>       <mx:HRule x="11" y="41" width="576" height="28"/>
>       <mx:HSlider id="resultSlider" styleName="glassSlider" 
> minimum="0" maximum="1000" tickInterval="50" snapInterval="10" 
> width="150" thumbCount="1" value="{resultStepper.value}" 
> labels="[0,1000]" liveDragging="true" change="updateStepper();" 
> height="25" x="10" y="18"/>
> 
> Also add the following actionscript:
> 
> private function updateStepper():void
> {
>  resultStepper.value=resultSlider.value;
> }
>         
>         
> private function updateSlider():void
> {
>  resultSlider.value=resultStepper.value;
> }
> 
> Wayne
> 
> --- In [email protected], "ilya Devers" <ilya.devers@> 
> wrote:
> >
> > Hi,
> > 
> > After a longtime just lurking i have ran into a mindboggling 
> > situation again.
> > 
> > This is the setup:
> > - regular cairngorm setup
> > - a view with two inputs, an input and a slider
> > - the slider has an snapInterval of 5000
> > - the text input has no Interval, obvious..
> > - when the user updates the slider he changes the input of the 
> > textfield
> > - by pressing a button the user triggers the calculation
> > - the text-input is bound to the value of the model
> > - triggering the calculation broadcasts a cairngorm event that 
> > updates the model.
> > This is a simplified situation to figure out what is happening, in 
> > the normal situation both input changes trigger the calculation.
> > 
> > What I want to happen is:
> > - user can use the slider to approximate the amount
> > - user can use the textinput to input an specific amount, this 
> sets 
> > the slider in the (snapintervalled rounded) area, but does not 
> > broadcast the cairngorm event (no change event should occur).
> > 
> > How i tried to implement this (just my script block)
> > 
> > import nl.robecodirect.rdinternet.model.ModelLocator;
> > 
> > private var delegate:Function;
> >             
> > function sliderChange(event){
> >     valueChanged(event.target.value);
> > }
> > 
> > // called on init   
> > private function handleInitialize(){
> >     delegate = mx.utils.Delegate.create(this, sliderChange);
> >     sliderBrutoJaarInkomen.addEventListener("change", delegate);
> > }
> >             
> > public function inputChange(event) {
> >     siderBrutoJaarInkomen.removeEventListener("change", 
> > delegate);
> >     sliderBrutoJaarInkomen.value=event.target.text;
> >     //this calls the EventBroadcaster..
> >     valueChanged(event.target.text);
> >     sliderBrutoJaarInkomen.addEventListener("change", delegate);
> > }
> > 
> > 
> > What happens is, checked in long debugging,:
> > 
> > After the complete cairngorm command and inputChange methods are 
> > finished, a new change event is fired from the slider, which sets 
> > the input box to the snapintervalled value...
> > 
> > Why o why, it drives me crazy.
> > Any insights, pointers, are welcome.
> > 
> > A reborn flex newbie ;)
> > ilya
> >
>






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to