# Preloader and loading external swf

**URL:** <https://forum.kirupa.com/t/preloader-and-loading-external-swf/184258>\
**Category:** Uncategorized\
**Created:** [April 3, 2006, 8:31pm UTC](https://forum.kirupa.com/t/preloader-and-loading-external-swf/184258 "2006-04-03T20:31:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jrutter](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/jrutter/32/2004_2.png) [@jrutter](https://forum.kirupa.com/u/jrutter)\
**Post date:** [April 3, 2006, 8:31pm UTC](https://forum.kirupa.com/t/preloader-and-loading-external-swf/184258/1 "2006-04-03T20:31:37Z")

</div>

Hey all,

So I have setup a mini flash site. I have some buttons on the right - then a movie clip called ‘container\_mc’ - currently there is a button at the bottom. When you click it - it loads a preloader - which loads an external swf file. It works beautifully - but I want to change it around so that instead of having to hit the button - when the page is loaded - it starts the pre-load instantly and the swf file will eventually play.

Here is the code currently off the button :

```auto
        replay_btn._visible = 0;

// movie 2 loads the tankturn swf using startPreload
movie1_btn.onPress = function(){
    startPreload("test_video-11.swf");
        replay_btn._visible = 100;

}

// this function begins preloading a swf url
function startPreload(url){
    
    movie1_btn._visible = 0;
    tunein_info._visible = 0;

    
    // use loadMovie to load the swf url into container_mc
    container_mc.loadMovie(url);
    
    // attach the preloader animation
    // this will be removed when preloading is complete
    attachMovie("preloader anim", "preloader_mc", 500, {_x:130, _y:120});
    
    // set the onEnterFrame event to call preloadContainer
    onEnterFrame = preloadContainer;
}

```

Would I be able to create an onClipEvent(load) type of action, because I tried that and the preloader just goes around in circles and the swf never loads.

Can someone help me out?
