# Problems getting onLoad to work for MovieClips \[renamed\]

**URL:** <https://forum.kirupa.com/t/problems-getting-onload-to-work-for-movieclips-renamed/113201>\
**Category:** Uncategorized\
**Created:** [June 15, 2004, 9:14pm UTC](https://forum.kirupa.com/t/problems-getting-onload-to-work-for-movieclips-renamed/113201 "2004-06-15T21:14:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![iloveitaly](https://avatars.discourse-cdn.com/v4/letter/i/7ea924/32.png) [@iloveitaly](https://forum.kirupa.com/u/iloveitaly)\
**Post date:** [June 15, 2004, 9:14pm UTC](https://forum.kirupa.com/t/problems-getting-onload-to-work-for-movieclips-renamed/113201/1 "2004-06-15T21:14:33Z")

</div>

I am trying to get a MC to respond to onLoad.  
Now i may not be a expert in AS but i’m not this stupid.  
I just put the code on the first frame on the timeline, theres only 1 frame so there is no need to stop() it. Heres the code:

```auto

_root.cloud.onLoad = function() {
trace("hi");
}

```

I’ve tried relative path and everything.  
Thw weird part is when i have tha code placed on the MC it works fine.  
The even weirder part of it is that if i just have onClipEvent(load){} placed on the MC the code on the timeline works fine. I have never had this problem before and am really stumped as to why it would do this.  
Is there some werid AS technicality?  
[.fla](http://ambwhitestudios.com/stumpted.fla)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 15, 2004, 10:59pm UTC](https://forum.kirupa.com/t/problems-getting-onload-to-work-for-movieclips-renamed/113201/2 "2004-06-15T22:59:30Z")

</div>

The file doesn’t work. Plus, the onLoad() handler is used for external variables.

```auto

var cloud = new LoadVars();
cloud.onLoad = function (success) {
//use the variables here...
}

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 15, 2004, 11:06pm UTC](https://forum.kirupa.com/t/problems-getting-onload-to-work-for-movieclips-renamed/113201/3 "2004-06-15T23:06:15Z")

</div>

ok, fixed the link.  
I know the onLoad() handler is user for loading external data, but cant it also be user for handling events in a moveclip on a timeline also? If not whats the equivalent event handler?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 15, 2004, 11:07pm UTC](https://forum.kirupa.com/t/problems-getting-onload-to-work-for-movieclips-renamed/113201/4 "2004-06-15T23:07:20Z")

</div>

only when used in MC classes  
[http://www.kirupa.com/developer/oop/AS1OOPClassesWithMCs7.htm](http://www.kirupa.com/developer/oop/AS1OOPClassesWithMCs7.htm)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 16, 2004, 2:17am UTC](https://forum.kirupa.com/t/problems-getting-onload-to-work-for-movieclips-renamed/113201/5 "2004-06-16T02:17:12Z")

</div>

ahh, ok thanks for clearing that up!
