# External swf on page load - no buttons

**URL:** <https://forum.kirupa.com/t/external-swf-on-page-load-no-buttons/292930>\
**Category:** Uncategorized\
**Created:** [July 21, 2009, 12:27am UTC](https://forum.kirupa.com/t/external-swf-on-page-load-no-buttons/292930 "2009-07-21T00:27:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![outroLugar](https://avatars.discourse-cdn.com/v4/letter/o/67e7ee/32.png) [@outroLugar](https://forum.kirupa.com/u/outroLugar)\
**Post date:** [July 21, 2009, 12:27am UTC](https://forum.kirupa.com/t/external-swf-on-page-load-no-buttons/292930/1 "2009-07-21T00:27:08Z")

</div>

All the tutorials I have found across the web is loading external swf’s with a button click. My fla has 3 already created mc’s on the stage that need to load 3 different swf’s. First one loads a random selection from 5 swf’s and that one works. But when I add the other two they do not work. This is whats on my first frame of the main file:

choice = Math.round(Math.random()\*4);  
switch (choice) {  
case 0 :  
\_root.lessons.loadMovie(“lessons0.swf”);  
break;  
case 1 :  
\_root.lessons.loadMovie(“lessons1.swf”);  
break;  
case 2 :  
\_root.lessons.loadMovie(“lessons2.swf”);  
break;  
case 3 :  
\_root.lessons.loadMovie(“lessons3.swf”);  
break;  
case 4 :  
\_root.lessons.loadMovie(“lessons4.swf”);  
break;  
}

This works but I need to have 2 more holders mc names loadContext and loadLegend, that load the files one named “context.swf” and other “legend.swf” respectively.  
I cant figure out how to make this second part work. I have the file on this [link](https://rcpt.yousendit.com/715870664/4aa27b5b1dff75299c07ba7c4797b0b8)  
(too large to put here)

Please help!
