# Help with roots/parents.

**URL:** https://forum.kirupa.com/t/help-with-roots-parents/523321
**Category:** flash
**Created:** [February 5, 2015, 8:40pm UTC](https://forum.kirupa.com/t/help-with-roots-parents/523321 "2015-02-05T20:40:09Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Geewhiz1011](https://avatars.discourse-cdn.com/v4/letter/g/f19dbf/32.png) [@Geewhiz1011](https://forum.kirupa.com/u/Geewhiz1011)
#### Post date: [February 5, 2015, 8:40pm UTC](https://forum.kirupa.com/t/help-with-roots-parents/523321/1 "2015-02-05T20:40:11Z")

</div>

Hi, I’ve got a nested movieclip here, and I would like to call another nested movieclip in the main timeline.  
My main idea was to do:

MovieClip(root.instance).instance.gotoAndPlay(1); ,

but that doesn’t work (obviously, I’m a newbie).  
Would I have to use parents or even children?

I’m using Actionscript 3.0 for this by the way.

---

<div class="post-metadata">

### Author: ![senocular](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/senocular/32/7217_2.png) [@senocular](https://forum.kirupa.com/u/senocular)
#### Post date: [February 5, 2015, 9:31pm UTC](https://forum.kirupa.com/t/help-with-roots-parents/523321/2 "2015-02-05T21:31:56Z")

</div>

Using the root approach, I think what you want is:

```javascript
MovieClip(root).instance.gotoAndPlay(1);

```

The purpose of MovieClip(…) is to cast a variable to be a certain type - a type other than what’s defined for that class. The .root property, for example, is defined as a DisplayObject, but MovieClips, as DisplayObjects, can be what root points to, so you can tell the root property (not root.instance) that you want to treat it as a MovieClip which then allows you to reference .instance or whatever from it.

---

<div class="post-metadata">

### Author: ![Geewhiz1011](https://avatars.discourse-cdn.com/v4/letter/g/f19dbf/32.png) [@Geewhiz1011](https://forum.kirupa.com/u/Geewhiz1011)
#### Post date: [February 5, 2015, 9:49pm UTC](https://forum.kirupa.com/t/help-with-roots-parents/523321/3 "2015-02-05T21:49:01Z")

</div>

Thanks for the explanation. I kinda get it now.  
I’m kicking myself right now for not thinking of that, though.  
I mean, it’s like the easiest thing in Flash programming, am I right? xD

Thanks again.

---

<div class="post-metadata">

### Author: ![senocular](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/senocular/32/7217_2.png) [@senocular](https://forum.kirupa.com/u/senocular)
#### Post date: [February 5, 2015, 9:57pm UTC](https://forum.kirupa.com/t/help-with-roots-parents/523321/4 "2015-02-05T21:57:54Z")

</div>

> [@Geewhiz1011](#):
>
> I mean, it’s like the easiest thing in Flash programming, am I right?

Not really 😉 Especially if you have any background in AS2, this whole need-to-cast-root-to-use sometimes thing will throw you for a loop. AS2 didn’t have that problem, and people moving from there to AS3 get a little time-to-deal-with-typing slap to the face. Its not always clear why its needed, or even why root is typed that way to begin with. I may have a slightly better explanation in the tips entry about this: [kirupaForum](http://www.kirupa.com/forum/showthread.php?223798-ActionScript-3-Tip-of-the-Day/page10&p=2120340#post2120340)
