# Activating Subcomponent onclick

**URL:** <https://forums.sketchup.com/t/activating-subcomponent-onclick/109553>\
**Category:** Dynamic Components\
**Tags:** subcomponents\
**Created:** [November 23, 2019, 12:30pm UTC](https://forums.sketchup.com/t/activating-subcomponent-onclick/109553 "2019-11-23T12:30:23Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![DanRathbun](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/danrathbun/32/500_2.png) [@DanRathbun](https://forums.sketchup.com/u/DanRathbun)\
**Post date:** [November 23, 2019, 1:15pm UTC](https://forums.sketchup.com/t/activating-subcomponent-onclick/109553/2 "2019-11-23T13:15:27Z")

</div>

> [@Ccaponigro](#):
>
> 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?

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.

```plaintext
=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”.)

> [@Ccaponigro](#):
>
> While I’m at it there a dynamic component syntax bible of sorts?

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

> [@Dynamic Components Resources \[wiki\]](https://forums.sketchup.com/t/dynamic-components-resources-wiki/25936/):
>
> Dynamic Components Resources These lists are wikis. They can be appended or repaired by anyone with wiki privileges. [card_index Directory of Resource Lists](http://forums.sketchup.com/t/dynamic-components-resources-wiki/25936/1)[notebook User Guide: Sectional Outline](http://forums.sketchup.com/t/dynamic-components-resources-wiki/25936/2)[card_box Keyword Index](http://forums.sketchup.com/t/dynamic-components-resources-wiki/25936/3)[[image] Training Components](http://forums.sketchup.com/t/dynamic-components-resources-wiki/25936/4)[mortar_board Tutorials](http://forums.sketchup.com/t/dynamic-components-resources-wiki/25936/5)[books Books](http://forums.sketchup.com/t/dynamic-components-resources-wiki/25936/6)[newspaper News & Blogs](http://forums.sketchup.com/t/dynamic-components-resources-wiki/25936/7)[bulb Tips & Tricks](http://forums.sketchup.com/t/dynamic-components-resources-wiki/25936/8)[notebook USERGUIDE](http://forums.sketchup.com/t/dynamic-components-resources-wiki/25936/2) | [card_box INDEX](http://forums.sketchup.com/t/dynamic-components-resources-wiki/25936/3) | [books BOOKS](http://forums.sketchup.com/t/dynamic-components-resources-wiki/25936/6) | [[image] COMPONENTS ](http://forums.sketchup.com/t/dynamic-components-resources-wiki/25936/4) | [newspaper NEWS](http://forums.sketchup.com/t/dynamic-components-resources-wiki/25936/7) | [bulb TIPS](http://forums.sketchup.com/t/dynamic-components-resources-wiki/25936/8) | […](http://forums.sketchup.com/t/dynamic-components-resources-wiki/25936/5)

---

_[View the full topic](https://forums.sketchup.com/t/activating-subcomponent-onclick/109553)._
