# Loading a Javascript file from Flash

**URL:** https://forum.kirupa.com/t/loading-a-javascript-file-from-flash/300239
**Category:** flash
**Created:** [November 18, 2009, 2:41am UTC](https://forum.kirupa.com/t/loading-a-javascript-file-from-flash/300239 "2009-11-18T02:41:49Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Julian500](https://avatars.discourse-cdn.com/v4/letter/j/43a26b/32.png) [@Julian500](https://forum.kirupa.com/u/Julian500)
#### Post date: [November 18, 2009, 2:41am UTC](https://forum.kirupa.com/t/loading-a-javascript-file-from-flash/300239/1 "2009-11-18T02:41:49Z")

</div>

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](http://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!
