Groups | Blog | Home
all groups > flash actionscript > april 2005 >

flash actionscript : Help With Action Script File



David Stiller
4/19/2005 7:16:03 PM
[quoted text, click to view]

I suspect ~eXe~ thinks this is a way to load the ActionScript file at
runtime, which is not possible. The #include compiler directive is a
mechanism for writing ActionScript externally from Flash (say, in Notepad,
Dreamweaver, SE|PY, Eclipse, etc.). This is not a way to dynamically change
ActionScript at runtime. The #include statement simply "pulls in" the
external .as file and compiles its contents into the SWF.

You don't need it on the server (the SWF, once compiled, ignores it).
You only need it in relation to your FLA.


David
stiller (at) quip (dot) net
"Luck is the residue of good design."

~eXe~
4/19/2005 8:58:26 PM
I need help I don't know how to call an Action script File..
kglad
4/19/2005 9:00:25 PM
#include "yourASfile.as"

~eXe~
4/19/2005 9:14:32 PM
ok but if i put that on the internet what will happen?
kglad
4/19/2005 10:24:54 PM
if you put that .as file on your server in the same directory as your swf file,
you don't need to specify a path and all that coding will have the same impact
it would if the code were in your swf file.
Jeckyl
4/20/2005 12:00:00 AM
Unfortunately ~eXe~ is trying to help people without having the knowledge to
back it up .. and ends up helping noone as a result. Good intentions .. but
not a good result.
--
Jeckyl

~eXe~
4/20/2005 12:24:07 AM
Well i don't own a =server i user
freewebs :(
David Stiller
4/20/2005 7:33:33 AM
[quoted text, click to view]

Your original question in this thread was ...

[quoted text, click to view]

What do you mean by "call"? ActionScript is compiled when you make your
SWF. From that point on, there is no "calling" of ActionScript. You can
load text files at runtime; you can load XML, CSS, JPGs, SWFs, MP3s, etc.,
but you cannot load ActionScript at runtime.


David
stiller (at) quip (dot) net
"Luck is the residue of good design."

~eXe~
4/20/2005 2:30:52 PM
Sorry i am still used to my old game creator...that was diffrent..But
I have a script that I am going to use over and over agian for geting items
but I dont wana keep puting it in because it is too big So, it will probley
lagg my game or make it bigger then i want it to be...and im not to sure how to
avoid this problem....
David Stiller
4/20/2005 7:12:13 PM
[quoted text, click to view]

By "script," you might mean "function." If you mean function, then
write your function in the main timeline, where you can access it globally.
In fact, you can write your function as a method of the _global object.

If you mean something else by "script," then, as mentioned, you may want
to write your script in an external text file and use the #include compiler
directive to include your script at compile time. In such a case, you would
not need your script on the server, only the SWF and the HTML document that
houses it.


David
stiller (at) quip (dot) net
"Luck is the residue of good design."

AddThis Social Bookmark Button