In Flash Pro CS5.5, I've created an Fla and scripted it (in AS3) using a separate AS file (package) which is linked. When I publish the SWF and both the SWF and AS files are in the same folder, it runs fine. If I separate out the SWF (without the AS file), and try to run it, it doesn't play (run the script).
How do I include (embed) the AS file into the published SWF so that wherever the SWF is located, it is self-contained so that it plays using the script from the AS file?
a compiled swf file is never accessing an .as script file. But check if you were using TLF textfields, then you need to have the 'textLayout_188.8.131.52.swz'-file in the same location as the swf.
If you want to have everything included in the swf, select 'merge into code' for textLayout.swc in the ActionScript settings.
Hope this helps.
Thank you for this explanation. After a lot of experimenting, I seem to be able to get the AS's script included in the published SWF, but 6 MP3's (although imported to library and/or stage) are still separated and, unless in the same folder as the SWF, will not work. With beginner skills, I think that maybe this is caused by these MP3's also being loaded in the separate AS file. Ithink that all of this could be solved if I could figure out how to put all the script in a single Fla, then maybe it could somehow also "embed" the 6 MP3's in the final published SWF. I've tried to re-do the AS file's script, but since these are "public" class definitions, etc., keep getting error messages. Quite a "mess." Not sure how to fix it.
even though you resolved your own issue (well done), here is how to include external .as files:
put this at the top of your code with all the other "imports" and such
Europe, Middle East and Africa