What’s up with onClipEvent (load)?

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

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

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

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?

…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). :slight_smile:

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

And welcome to kirupa forum! :stuck_out_tongue:

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

You’re welcome, greg. :slight_smile:

Originally posted by gregFly
If you’re ever in London town, I owe u a drink!

…Sounds like a plan. :wink: