# Loading in external .as files

**URL:** <https://forum.kirupa.com/t/loading-in-external-as-files/96990>\
**Category:** Uncategorized\
**Created:** [December 16, 2003, 9:08am UTC](https://forum.kirupa.com/t/loading-in-external-as-files/96990 "2003-12-16T09:08:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![1111](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/1111/32/206_2.png) [@1111](https://forum.kirupa.com/u/1111)\
**Post date:** [December 16, 2003, 9:08am UTC](https://forum.kirupa.com/t/loading-in-external-as-files/96990/1 "2003-12-16T09:08:39Z")

</div>

Hi,

Okay, i know how to load in external .as files so I can update easily. but why do you still have to re-publish the swf in order for the new .as file 2 take effect.

is there any way that you can make a .as file be read in & so that it updates the .swf file, much like the way loading an xml or .txt file does?.

any comments are appreciated…  
thanks

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 17, 2003, 2:54am UTC](https://forum.kirupa.com/t/loading-in-external-as-files/96990/2 "2003-12-17T02:54:53Z")

</div>

I think the point might have been missed. External .as files are NOT accessed when the movie is _played_. They are accessed and included when the movie is _created_. So any change you might make to an .as file that you used within your movie would require you to republish your movie so those changes can be added in to the .swf file. Once that swf file is complete, the .as file is no longer needed for it to run properly (as the code was’included’ when the swf was created).

So with that, there technically isnt a way to reference an external .as file AFTER the movie has been made and simply make changes in that .as file to have that then reflected in the swf without republishing. You would instead want to load in a text file with load variables or get information through xml with the XML object and an external xml file. These methods are still pretty much primarily for variable values to help direct your movie. They cannot provide commands to control it where Flash would then just be able to rea a bunch of code and make it work. Id doesnt work like that.

However, there have been attempts made at actually making a parser for actionsctipt with actionscript so that could be accomplished. The best Ive seen (which is quite impressive - as it should be, a lot went into it) can be found here:  
[http://flashcomponents.net/component.cfm?nav=2&id=118](http://flashcomponents.net/component.cfm?nav=2&id=118) (Flash MX)  
note that this wont work with all code and that will be much more a strain on the processor to handle in comparison to code included at time of publish or creation.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 17, 2003, 2:59am UTC](https://forum.kirupa.com/t/loading-in-external-as-files/96990/3 "2003-12-17T02:59:25Z")

</div>

[http://www.kirupa.com/developer/actionscript/tricks/cache.htm](http://www.kirupa.com/developer/actionscript/tricks/cache.htm)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 17, 2003, 3:00am UTC](https://forum.kirupa.com/t/loading-in-external-as-files/96990/4 "2003-12-17T03:00:52Z")

</div>

Brilliant. Thanks Senocular.

I was hoping you could shed some light on the subject. I have  
seen your greatness with xml, so many thanks.

I will do some hard research into it as I know it is not that simple.

thanks again!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 17, 2003, 3:22am UTC](https://forum.kirupa.com/t/loading-in-external-as-files/96990/5 "2003-12-17T03:22:39Z")

</div>

welcome 😃
