CoBubble's Javascript Component

The documentation for this component is somewhat sketchy.
For instance it is not obvious that the javascript is expected to be in a single function.
It also isn’t entirely clear how the component picks up the returned value and puts it into the list.

Anyway my objective is to build a simple colorpicker because the Air one seems to break a lot.

The colorpicker consists of three sliders 0-256 for R G B plus a “This color” button. The background color of the button is set to the state of the javascript which (in turn) is the first returned value in the list.

The job of the javascript is simply to convert the slider values into a colour string.

function slidertocolour (){
a =sliderA’s Value;
b =SliderB’s Value;
c = sliderC’s Value;
ahex = a.toString(16);
bhex = b.toString(16);
chex = c.toString(16);
hash = “#”;
Colorval = hash.concat(ahex, bhex, chex);
Return Colorval;}

is what I have now. Unfortunately this throws the error:

“The plugin Components threw the following error: Unexpected identifier”

Which does not help much. Should the slider values be in the parameters?

This component seems to have lots of people rating it highly so you must all be much smarter than me. Can anyone tell me what I’m doing wrong?


This topic was automatically closed after 70 days. New replies are no longer allowed.