Loading a Javascript file from Flash

Hello! I currently have a photography website that calls a javascript file from the html page. there are nine galleries of photos and this javascript file loads all the images as soon as the viewer lands on the page where they can select the galleries.

my problem:

the photos load in order from top galleries in the list to bottom, which fits most viewers’ patterns (from analytics). however, if a viewer clicks a bottom gallery and wants to see a photo, they have to wait till all prior photos are done loading.

here is the url www.julianwalter.com/flash.html

instead, what I would like to happen is that whenever the user clicks a gallery, the swf calls for a javascript file to load the images of just that gallery. right now I have a few on(release) commands.

does anybody know how to call a javascript file from a flash swf?

thank you so much!