Loading in external .as files

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

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 (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.

http://www.kirupa.com/developer/actionscript/tricks/cache.htm

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!

welcome :smiley: