We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Socket in Flash SWF

Medium Priority
706 Views
Last Modified: 2012-06-27
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?
Comment
Watch Question

CERTIFIED EXPERT
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Mohamed AbowardaSenior Software Engineer
CERTIFIED EXPERT

Author

Commented:
It's now asking me for policy file, even after I added policy file it keep asking for it.
CERTIFIED EXPERT

Commented:
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
Mohamed AbowardaSenior Software Engineer
CERTIFIED EXPERT

Author

Commented:
Please post XML file example for localhost, connecting to port 10000.

Thanks,
CERTIFIED EXPERT

Commented:
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);
Mohamed AbowardaSenior Software Engineer
CERTIFIED EXPERT

Author

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.
CERTIFIED EXPERT

Commented:
Top Expert 2011
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Mohamed AbowardaSenior Software Engineer
CERTIFIED EXPERT

Author

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.
Mohamed AbowardaSenior Software Engineer
CERTIFIED EXPERT

Author

Commented:
I have resolved the problem by sending the policy XML from the server to the client.

Thanks all,
Mohamed AbowardaSenior Software Engineer
CERTIFIED EXPERT

Author

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.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.