N
Nick
I have been tasked to figure out a way to communicate from a
JavaScript /XUL client to a server, but without using a web server.
I have been researching different possibilities, and I have come upon
<a href = "http://aflax.org">aflax</a>, which is a library for
imbedding flash in JavaScript. So far I have been able to get it to
connect, but only if the server script is running locally along with
the flash content and client. I am using the example of a chat
program at aflax.org - http://aflax.org/examples/sockets/sockets.html
.. you can see the example there but unfortunately the demo does not
work, and Aflax forums have not provided a response.
1) Why should the HTML file (with JavaScript and Aflax) act
differently when it is opened as a file:// as opposed to on a
localhost web server? It does not connect to the server when I simply
open the file from my filesystem rather than being served it on a web
server. The Firefox error console notes this error when I use the
filesystem method: __flash__argumentsToXML is not defined . This
error is not present when it is served from the web server, but a
google search doesn't yield any help for me - only the same function
embedded in lots of other code.
2) If I run the web server locally and open the HTML file, but run
the server (simply a perl script), it also does not connect to the
server. Someone suggested this may relate to setting the
crossdomain.xml. I Set it the domains to *, and it still did not
work. Because I am running it on a local LAN, i'm not even sure what
domain I would put there.
If this is an inappropriate place to post, I apologize, but I'm really
grasping at straws here - I don't know if the problem is JavaScript,
Flash code, Flash player settings, the Aflax library, or what. I did
go into the flashplayer settings here:
http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager02.html#118539
to allow this particular flash file to connect out to the Internet.
Thanks,
Nick
JavaScript /XUL client to a server, but without using a web server.
I have been researching different possibilities, and I have come upon
<a href = "http://aflax.org">aflax</a>, which is a library for
imbedding flash in JavaScript. So far I have been able to get it to
connect, but only if the server script is running locally along with
the flash content and client. I am using the example of a chat
program at aflax.org - http://aflax.org/examples/sockets/sockets.html
.. you can see the example there but unfortunately the demo does not
work, and Aflax forums have not provided a response.
1) Why should the HTML file (with JavaScript and Aflax) act
differently when it is opened as a file:// as opposed to on a
localhost web server? It does not connect to the server when I simply
open the file from my filesystem rather than being served it on a web
server. The Firefox error console notes this error when I use the
filesystem method: __flash__argumentsToXML is not defined . This
error is not present when it is served from the web server, but a
google search doesn't yield any help for me - only the same function
embedded in lots of other code.
2) If I run the web server locally and open the HTML file, but run
the server (simply a perl script), it also does not connect to the
server. Someone suggested this may relate to setting the
crossdomain.xml. I Set it the domains to *, and it still did not
work. Because I am running it on a local LAN, i'm not even sure what
domain I would put there.
If this is an inappropriate place to post, I apologize, but I'm really
grasping at straws here - I don't know if the problem is JavaScript,
Flash code, Flash player settings, the Aflax library, or what. I did
go into the flashplayer settings here:
http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager02.html#118539
to allow this particular flash file to connect out to the Internet.
Thanks,
Nick