-
problem with "#include"
I'm trying to make a flash game where people write small files, and they get included into the game.
However, I need to use #include with a variable, but it won't let me (malformed). I need it to be a variable so the user can choose the file to be included.
Anyways, how can I get around this? I need it so it will import the script and use it, if theres another way I'll be happy to hear.
Also, I'm using MX.
Last edited by Hexagon_Clock; 10-01-2004 at 10:53 AM.
-
I don't personally recommend using #include, I like to use loadVar(); Do a google search on loadVar() and I'm sure you will be pleased.
If computer games affected us, would I not be running into walls popping strange yellow pills and listening to repetitive music?
-
Originally posted by frozenfire89
I don't personally recommend using #include, I like to use loadVar(); Do a google search on loadVar() and I'm sure you will be pleased.
Will it load actionscript?
-
Senior Member
#include is intended to provide flash developers with a way to reuse code among multiple projects. It is a preprocessor command, meaning the code has already been included when you publish your SWF file - as far as your SWF file is concerned, there are no #includes - just code.
There is no way to dynamically load and compile actionscript - the compilation is performed by the Flash authoring software, not the player. You can dynamically load other SWFs however, using loadMovie().
- Jim
-
I recommend you pre-define the a bunch of functions, and make it so that a user can use different identifiers to activate these functions.
If computer games affected us, would I not be running into walls popping strange yellow pills and listening to repetitive music?
-
Thanks a million jbum (from the future: 2009) 
You saved my butt a ton of work. I was about to totally give up on #includes until you explained how they aren't loaded as an "external file" but instead are "compiled in" the .swf file during the "Publish" or "Test Movie".
I never in a thousand years would have figured that out.
You are the hero of 2009 
 Originally Posted by jbum
#include is intended to provide flash developers with a way to reuse code among multiple projects. It is a preprocessor command, meaning the code has already been included when you publish your SWF file - as far as your SWF file is concerned, there are no #includes - just code.
There is no way to dynamically load and compile actionscript - the compilation is performed by the Flash authoring software, not the player. You can dynamically load other SWFs however, using loadMovie().
- Jim
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|