Activating Subcomponent onclick

I’m creating a glass elevator I’ve created the shaft and the cab. I was able to get the cab to go up and down onclick. The problem is the cab is wholly enclosed in the glass shaft so I can’t click on it. How do I get the parent component to call the sub components function? While I’m at it there a dynamic component syntax bible of sorts?

It’s been awhile, but I think that you define the onClick function on the parent (outermost) DC component, and refer to the subcomponent’s Z attribute.

=ONCLICK(ANIMATECUSTOM("Cab!Z", 5, 100, 100, "BottomFloor", "TopFloor"))

IE, Animate the “Cab” subcomponent, over a time of 5 seconds (easein and easeout at maximum) between the z values of “BottomFloor” and “TopFloor” hidden attributes of the parent component. (At least this is what I’m trying to show. You could use literal z values if you prefer. If you wish the cab to stop at multiple floors [per each click,] add more stops to the parameter list between “BottomFloor” and “TopFloor”.)

In this category is a pinned thread of wiki lists for your enjoyment …

2 Likes

Thank you. I’ll dive in.

eureka! it works Here it is. Savaria ViewliftPOTTS ELEVATOR.skp (394.6 KB)

1 Like