-
eval (#include links.as)???
Hi guys
does anybody know how to use #include with eval()?
I have a if statement
if(x==1)
{
//I want to load one.as here
}
else if (x==2)
{
//I want to load two.as here
}
thanks in advance
"When u think from ur heart and feel from ur mind...u find urself in a midst of whirlpool of illusions" - DJ
-
Senior Member
Why do you need Eval for this?
you can try something like this. Whatever your condition is.
var myname = false;
if (myname) {
#include "one.as"
} else {
#include "two.as"
}
dipkya
---------------------------------------------------------------
SO MUCH HAVE TO DO, SO LITTLE HAS DONE!
-
#include include AS files when the movie is compiled. It cannot be used to load script during runtime.
to do this you need to put the script in an swf and load that instead.
/Mirandir
-
I am trying to make an updatable directory in flash
so I want the user to have total control.....
the .as file will be updated by another program
and a flash exe will read that file and display its contents
m taking all the values of combobox from diff .as files
I tried
if (place.getSelectedItem().label == "NY") {
#include "NY.as"
}
where "place" is the instance name of combobox
but it gives syntax error...so i thought I might solve the prob with eval
...
"When u think from ur heart and feel from ur mind...u find urself in a midst of whirlpool of illusions" - DJ
-
Then you should build an "engine" that reads textfiles/xml and adapts the movie from that instead. Much easier to manage updates that way.
/Mirandir
-
can i read XML without using a server??
"When u think from ur heart and feel from ur mind...u find urself in a midst of whirlpool of illusions" - DJ
-
ofcourse you can!
If you save it in an plain textfile. You can then load it with the xml object.
/Mirandir
-
Senior Mender
The syntax erro came i think because you should always put a line with just a ; folowing an include statement.
You can load xml directly in flash using the xml object load function
var my_xml = new XML()
my_xml.onLoad = function()
{
//do something when it is load
}
my_xml.load("my_url_to.xml")
-
Senior Mender
You should use a server to load an xml file only when it is modified by the user and you don't want the file to load from the cache...
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
|