# onLoad Function prob. \[f8\] in mc not root

**URL:** <https://forum.kirupa.com/t/onload-function-prob-f8-in-mc-not-root/222891>\
**Category:** Uncategorized\
**Created:** [April 17, 2007, 7:31pm UTC](https://forum.kirupa.com/t/onload-function-prob-f8-in-mc-not-root/222891 "2007-04-17T19:31:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dr\_Abner\_Mellon](https://avatars.discourse-cdn.com/v4/letter/d/51bf81/32.png) [@Dr\_Abner\_Mellon](https://forum.kirupa.com/u/Dr_Abner_Mellon)\
**Post date:** [April 17, 2007, 7:31pm UTC](https://forum.kirupa.com/t/onload-function-prob-f8-in-mc-not-root/222891/1 "2007-04-17T19:31:48Z")

</div>

I’m a little lost… I’m very new to flash and I some help 🙂 I can’t figure out what little thing I’m missing to make this work if its not on the root. It’s only 1 MC inside…

Below is the script I using 🙂

```auto
this.onLoad = function() {
    a = 1;
    //duration = 1;
    //Use a fractional number to
    //cut the duration:
    duration = 0.92;
    maxang = 60;
    speed = 1;
}
this.onEnterFrame = function() {
    setProperty(_root.chandelier, _rotation, (((Math.sin (speed*a))*(Math.pow (duration, a ))))*maxang);
    a = a+0.1;
}

```
