Switch in a Subcomp not working?

I can’t seem to get Switch to work when in a subcomp? I’m using Receive Keyboard Buttons in the parent comp. It appears that it’s not sending data to the output in this comp.

Screen Shot 2016-03-29 at 10.16.44 AM.png

jersmi.switchSubcomp.vuo (753 Bytes)

Btw, this issue just surfaced trying to get my ADSR-ish setup to work as a subcomp.

Also, I got this message uploading the file so probably need to rename the subcomp without the underscore.

For security reasons, your upload has been renamed to jersmi.adsr_.vuo.

jersmi.adsr_.vuo (8.21 KB)

audioADSR.vuo (13.9 KB)

Each event into the subcomposition comes in through all published input ports. So when the jersmi.switchSubcomp node gets an event into its Turn On input port, that event goes into through both the TurnOn and TurnOff published inputs, and on to both the Turn On and Turn Off input ports of the Switch node.

See feature request Ability to do something special (port action) when a specific subcomposition input port gets an event for more explanation. That feature request would make it possible to successfully wrap a Switch node in a subcomposition.

For security reasons, your upload has been renamed to jersmi.adsr_.vuo.

Unlike other things done “for security reasons” like making you take off your shoes at the airport, this one actually is legitimately for security :) The file renaming prevents an exploit in which someone would upload a file called blah.php.vuo and the web server would interpret the file as PHP and allow it to be executed. Allowing anyone to upload PHP code and have it execute on our web server would be bad.

I’d recommend that you zip subcompositions before uploading to avoid having them renamed. (As a bonus, it also avoids having the subcomposition file renamed if a file with the same name has previously been uploaded.)

Thanks, Jaymie. The default subcomp behavior sure does undermine my intuitive approach, thinking things like the ADSR subcomp above should “just work”. Folks seem to get how to find some workarounds, still befuddling for me… Looking forward to seeing how the port actions FR can help.

I appreciate the explanation on security. I’ll zip! Cheers. :-)