Socket in Flash SWF

Hi,

I have created socket swf application and I want to use it in a website to connect to the server and get data.

It's not working on SWF, it only work after I compile it to EXE.

How can I get socket to work with SWF?
LVL 12
Mohamed AbowardaSoftware EngineerAsked:
Who is Participating?
 
dgofmanCommented:
You have to stream XML crossdomain format from your backend when you are using socket connection.
0
 
Randy DownsOWNERCommented:
0
 
Mohamed AbowardaSoftware EngineerAuthor Commented:
It's now asking me for policy file, even after I added policy file it keep asking for it.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
Randy DownsOWNERCommented:
Have you tried different browsers? It looks like some browsers may not support it.

1.Try Chrome and Firefox 3.x.

¿It doesn't work on Chrome:
It's likely an issue of your code or the server. Debug your code as usual e.g. using console.log.
¿It works on Chrome but it doesn't work on Firefox:
It's likely an issue of web-socket-js specific configuration (e.g. 3 and 4 below).
¿It works on both Chrome and Firefox, but it doesn't work on your browser:
Check "Supported environment" section below. Your browser may not be supported by web-socket-js.

Also you may want to different ports

policy file at port 843, modify the file to allow access to port 10081
0
 
Mohamed AbowardaSoftware EngineerAuthor Commented:
Please post XML file example for localhost, connecting to port 10000.

Thanks,
0
 
Randy DownsOWNERCommented:
Try this - http://wiki.mediaboxtraining.com/doku.php/flash:sockets_creating

// creation of the connection
var connection:XMLSocket = new XMLSocket("localhost", 10000);In the case where the address used is not specified upon instantiation, we can use the connect method:

// creation of the object XMLSocket
var connection:XMLSocket = new XMLSocket();
// connection to the socket server
connection.connect("localhost", 10000);
0
 
Mohamed AbowardaSoftware EngineerAuthor Commented:
I am using Socket not XMLSocket().

Now I only want it to work on the server, it still require the policy file.
I want policy file that will make it work on localhost post 10000.
0
 
Mohamed AbowardaSoftware EngineerAuthor Commented:
@dgofman: I need XML file "crossdomain.xml" example that allow flash connection on localhost port: 10000.

I have tried to use several files and it doesn't work.
0
 
Mohamed AbowardaSoftware EngineerAuthor Commented:
I have resolved the problem by sending the policy XML from the server to the client.

Thanks all,
0
 
Mohamed AbowardaSoftware EngineerAuthor Commented:
I have found that I need to end the data streaming by specific char so the client will know that the policy sending is completed.

Since the problem is now resolved I am closing this question.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.