# Waiting for a clip to load before calling a function

**URL:** <https://forum.kirupa.com/t/waiting-for-a-clip-to-load-before-calling-a-function/167116>\
**Category:** flash\
**Created:** [October 25, 2005, 5:00pm UTC](https://forum.kirupa.com/t/waiting-for-a-clip-to-load-before-calling-a-function/167116 "2005-10-25T17:00:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![imon](https://avatars.discourse-cdn.com/v4/letter/i/5f8ce5/32.png) [@imon](https://forum.kirupa.com/u/imon)\
**Post date:** [October 25, 2005, 5:00pm UTC](https://forum.kirupa.com/t/waiting-for-a-clip-to-load-before-calling-a-function/167116/1 "2005-10-25T17:00:50Z")

</div>

Is something wrong with this code? I am trying to tell Flash to wait to call generateEventClips() until timeline\_events.swf has been fully loaded into events\_mc. But I don’t think it is doing so, because the clips that the function is supposed to generate don’t appear unless i call the function at least two frames later.

var events\_mc = new MovieClipLoader();  
events\_mc.addListener();  
events\_mc.loadMovie(“timeline\_events.swf”);  
events\_mc.onLoadComplete = generateEventClips();
