Slider control for opacity?

Has anyone ever created a slider that would feed its output to a value, like transparency in the rgba range? Just wondering if I could recycle something… :slight_smile:

The easiest way is to use a standard HTML-control:

(here the changed value is written in the red cell below)

slider.zip (176.3 KB)

here an example using a custom slider (built using Antetype). The slider is linked to the opacity of the red cell covering the content:

It works similar to the scripts in the Interactive drag the knob contains a mouse-down-event-handler which adds a mouse-move event-listener to listen on the mouse-movement. The Event-Listener is removed on mouse-up.

(I use the Event.movementX which is not available in older Safari versions … ).

slider2.zip (567.3 KB)

This is so amazing. Thanks! You really need to add a UI for these things. I cannot be coming back all the time begging you guys for code snippets :laughing:

just keep on begging :grinning: … until we provide a UI

1 Like

So how would I change the script in order that a number is set from 0% to 100% and the fill behind adapted accordingly?
image