# What’s up with onClipEvent (load)?

**URL:** <https://forum.kirupa.com/t/what-s-up-with-onclipevent-load/42645>\
**Category:** Uncategorized\
**Created:** [February 11, 2004, 1:43pm UTC](https://forum.kirupa.com/t/what-s-up-with-onclipevent-load/42645 "2004-02-11T13:43:57Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![gregFly](https://avatars.discourse-cdn.com/v4/letter/g/9de0a6/32.png) [@gregFly](https://forum.kirupa.com/u/gregFly)\
**Post date:** [February 11, 2004, 1:43pm UTC](https://forum.kirupa.com/t/what-s-up-with-onclipevent-load/42645/1 "2004-02-11T13:43:57Z")

</div>

Dear Group

I would like to load an external swf into a movie clip but I want to put the action script not in a layer, but in the movie clip itself. So I’m going with onClipEvent (load) . I have this script on the movie clip

onClipEvent (load) {  
loadMovie(“pic1.swf”, this);  
}

But…nothing happens! What am I doing wrong? I have changed the target from this to the name of the movieclip but also, no joy. Pls guys, any help would be greatly appreciated.

Thanks in advance  
Vic

---

<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:** [February 11, 2004, 3:15pm UTC](https://forum.kirupa.com/t/what-s-up-with-onclipevent-load/42645/2 "2004-02-11T15:15:19Z")

</div>

The code should work. You dont get any errors on the output window?

---

<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:** [February 11, 2004, 3:22pm UTC](https://forum.kirupa.com/t/what-s-up-with-onclipevent-load/42645/3 "2004-02-11T15:22:28Z")

</div>

everytime it loads, its reloading. dont put that in onClipEvent(load)

---

<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:** [February 12, 2004, 10:24am UTC](https://forum.kirupa.com/t/what-s-up-with-onclipevent-load/42645/4 "2004-02-12T10:24:35Z")

</div>

Thanks guys for replying.

claudio- I dont get any error message whatsoever from the output window.

senocular, I’m not quite sure what you mean. I was under the impression that the onClipEvent code only executes once and doesnt repeat itself. Okay so I might be wrong, but still, how am I going to load an external swf into a mc by placing the code into the mc and not a layer?

---

<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:** [February 12, 2004, 9:01pm UTC](https://forum.kirupa.com/t/what-s-up-with-onclipevent-load/42645/5 "2004-02-12T21:01:56Z")

</div>

…I guess you could use an [font=courier new]if[/font] statement to check if bytes total of the movie clip is equal to 4 (which is the size of an empty movie clip placed on the stage). 🙂

```auto
onClipEvent (load) {
	if (this.getBytesTotal() == 4) {
		this.loadMovie("pic1.swf");
	}
}

```

And welcome to kirupa forum! 😛

---

<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:** [February 18, 2004, 11:27am UTC](https://forum.kirupa.com/t/what-s-up-with-onclipevent-load/42645/6 "2004-02-18T11:27:09Z")

</div>

Thanks! The code works like a charm. If you’re ever in London town, I owe u a drink!

---

<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:** [February 18, 2004, 11:31am UTC](https://forum.kirupa.com/t/what-s-up-with-onclipevent-load/42645/7 "2004-02-18T11:31:35Z")

</div>

You’re welcome, greg. 🙂

> _Originally posted by gregFly_  
> **If you’re ever in London town, I owe u a drink!**

…Sounds like a plan. 😉
