# onClipEvent(load)

**URL:** <https://forum.kirupa.com/t/onclipevent-load/181224>\
**Category:** flash\
**Created:** [March 7, 2006, 3:28pm UTC](https://forum.kirupa.com/t/onclipevent-load/181224 "2006-03-07T15:28:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![flash\_uk](https://avatars.discourse-cdn.com/v4/letter/f/d26b3c/32.png) [@flash\_uk](https://forum.kirupa.com/u/flash_uk)\
**Post date:** [March 7, 2006, 3:28pm UTC](https://forum.kirupa.com/t/onclipevent-load/181224/1 "2006-03-07T15:28:24Z")

</div>

Hi

I have a movie clip which has the following code attached to it:

```auto

onClipEvent (load) {
    System.security.allowDomain("http://www.url.com");
    this.loadMovie("http://www.url.com/clip1.swf");

    if (this.getBytesLoaded() == this.getBytesTotal()) {
        // code to execute
        trace('here');
        delete this.onLoad;
    }
}

```

The problem is that I get an infinite loop, which I understand is correct for onClipEvent, but which I don’t want. The external movie loads fine, and I get trace from it, as well as a lot of ‘here’ output.  
I would like the loop to stop once the movie has loaded. Also, I would prefer the script to be attached to the clip and not to a frame as I would like to replicate this for three other external movies, and the neater it is the better.

Does anyone have any ideas?
