Hello Jeff,
you setup the inputs and outputs-count in the old JavaScript-Patch inspector
above the JS code. the inputs and outputs are referred as you did in your
example.
My ideas on your example code:
1) I think if "inputs[0]" is "2" the "outputs[1] and outputs[3] are undefined,
you have to set them to be sure what their values are.
2) Don't forget: the outputs-index starts at "0". so also use the outputs[0]!
3) your code does, what the "Demultiplexer" patch is doing (don't now if this
was in QC2 already, thought)
Best,
Achim Breidenbach
Boinx Software Ltd.
On 22.08.2012, at 21:12, Jeff wrote:
> Anyone know how to refer to the inputs on a javaScript patch in QC 2?
>
> I am trying to use a switch and have coded like this:
>
> switch (inputs[0]) {
>
> case 1: outputs[1] = "One"; break;
> case 2: outputs[2] = "Two"; break;
> case 3: outputs[3] = "Three"; break;
>
> }
>
> (not my actual data, just an example)
>
>
> In QC 4, I would name the inputs when i declared the function and use that
> name when referring to the value of the input, but javascript in QC 2 seems
> to be a little different.
>
> The whole point of this is that I created a QC screen saver to act as sort of
> a digital information display while working with QC 4 in Lion, but the actual
> screen savers need to function on Mac's that are running Tiger. The screen
> savers don't seem to function there and when I try to open the composition in
> QC 2 which is what I have on my Tiger machines, it crashes QC, thus the need
> for me to recode my javascript since I need to recreate my composition in QC
> 2 now. :(
>
> Thanks for the help.
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Quartzcomposer-dev mailing list ([email protected])
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/quartzcomposer-dev/achim%40boinx.com
>
> This email sent to [email protected]
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com
This email sent to [email protected]