Sg2.9
Updating the length of a line...
Recent RSS
Updating the length of a line by slider in realtime?
From:  alta
Date:  15. March 2012, 10:02

Hi,

I was just wandering if any one could point me out to the right direction!
How can I update the length of a line in realtime by a slider?

...or maybe animating the length by a slider!

What I want to learn is, how to send the value from the slider to update an object in realtime.

Thank you in advanced
//A

Updating the length/value of an object by slider in realtime?
From:  alta
Date:  15. March 2012, 11:48

Well, I've managed to update the text... But it's only on release of the slider!
How can I dynamically update the value?

//A

// Send the value to a text field from the slider

var values = { 
    percentage: 50
}; 
var components = { 
    percentage: { 
        type: 'slider', label: 'Percentage', 
        range: [0, 100] 
    }
}; 

var palette = new Palette('Range Examples', components, values);
var position = new Point(0, 0);
var textItem = new PointText(position);

textItem.content = values.percentage;

palette.onChange = function () {
	textItem.content = values.percentage;
}
Scripts
08.08.14, 15:24
15.05.14, 14:23
02.03.14, 19:16
18.11.13, 14:48
22.03.13, 03:05
22.02.13, 15:45
Posts
10.01.17, 16:37
19.02.16, 06:03
19.02.16, 06:00
17.01.16, 11:00
12.01.16, 13:10
25.11.15, 08:19
Script of the Moment
Growth2 and its partner 03.08.12