# Pulling variables from "parent"

**URL:** <https://forum.kirupa.com/t/pulling-variables-from-parent/250072>\
**Category:** Uncategorized\
**Created:** [January 25, 2008, 5:04am UTC](https://forum.kirupa.com/t/pulling-variables-from-parent/250072 "2008-01-25T05:04:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![patrickjv](https://avatars.discourse-cdn.com/v4/letter/p/ce7236/32.png) [@patrickjv](https://forum.kirupa.com/u/patrickjv)\
**Post date:** [January 25, 2008, 5:04am UTC](https://forum.kirupa.com/t/pulling-variables-from-parent/250072/1 "2008-01-25T05:04:37Z")

</div>

I have a simple situation but can’t figure out why it’s working

I have a MC1 with a comp.as class file  
I have a MC2 with a object.as class file  
I have a MC3 with a shape

- MC1 has all variables for the animation (including ‘minduration’ and ‘maxduration’). It creates a number of MC2 children and places them at random positions. Done with array object[] and counter ‘ct’

```auto
object[ct] = new classes.dollar.object();
addChild(object[ct]);

```

- every MC2 creates a MC3 child. Done with array obj[] and MC3 linkage name “shape”

```auto
 obj[0] = new shape();
addChild(obj[0]);

```

So far so good, a bunch of shapes appear in movie when tested.

Now I am trying to make MC2 give itself a variable ‘duration’ made from a random value between ‘minduration’ and ‘maxduration’. It won’t work. Anybody any idea how to extract it? MovieClip(parent) won’t do the trick.

Anybody?
