powered by Jive Software

Connection failed on webserver

I have created an application and it all works fine when testing within Flash and also when running the SWF in the flash player. When I uploaded the SWF to my website it is failing to connect to the jabber server,as i can’'t trace anything I am not sure what it is doing or where it is failing.

Does any one have any ideas why this might be happening?

It appears you are another victim of the Flash security sandbox You can only connect to a server that is residing on the same domain as the SWF.

See this thread for info on getting around it if you can’'t host the server on the same domain:


Hi, Thanks for the link.

I have tried adding a crossdomain.xml file, and I also tried a System.security.loadPolicyFile() refering to another, but still no connection. I created a new SWF that traces all event listeners events to a text field. It stops when while trying to execute the connection.connect(“flash”);.

So I am assuming that it is still not been granted access to the external domain. Any ideas anyone?

Here is what I have tried. I also tried just the line load(“www.xxxxxxx.com/crossdomain.xml”) instead of the load sucess stuff.


import org.jivesoftware.xiff.data.Message;

import org.jivesoftware.xiff.core.XMPPConnection;

import org.jivesoftware.xiff.im.Roster;


var my_lv:LoadVars = new LoadVars();

my_lv.onLoad = function(success:Boolean) {

if (success) {

_root.mess.text = _root.mess.text*"\r"*“Cross Domain Loaded”;


} else {

_root.mess.text = _root.mess.text*"\r"*“Error loading cross domain.”;






var connection = new XMPPConnection();

connection.username = “xxxxxx”;

connection.password = “xxxxx”;

connection.server = “jabber.org”;


_root.mess.text = “MOVIE LOADED.”;


var roster = new Roster(connection);


// Event handler

eventHandler = new Object();

eventHandler.handleEvent = function(eventObj) {

switch (eventObj.type) {

case “outgoingData” :


_root.mess.text = _root.mess.text*"\r"*“OUTGOING”;


case “incomingData” :


_root.mess.text = _root.mess.text*"\r"*“INCOMING”;


case “rosterUpdate” :

//trace(“ROSTER CHANGE”);


case “login” :

trace(“Logged in”);

_root.mess.text = _root.mess.text*"\r"*“Logged in”;


case “message” :


_root.mess.text = _root.mess.text*"\r"*“message”;


case “registrationFields” :

trace(“REG FIELDS”);

_root.mess.text = _root.mess.text*"\r"*“REG FIELDS”;


case “registrationSuccess” :


_root.mess.text = _root.mess.text*"\r"*“REGISTATION SUCCESS”;


case “disconnection” :


_root.mess.text = _root.mess.text*"\r"*“DISCONNECTION”;


case “connection” :


_root.mess.text = _root.mess.text*"\r"*“CONNECTION”;


case “error” :

trace("ERROR “eventObj.errorCode”: "+eventObj.errorMessage);


case “userAvailable” :


_root.mess.text = _root.mess.text*"\r"*“userAvailable”;


case “userUnavailable” :






connection.addEventListener(“registrationFields”, eventHandler);

connection.addEventListener(“registrationSuccess”, eventHandler);

connection.addEventListener(“outgoingData”, eventHandler);

connection.addEventListener(“incomingData”, eventHandler);

connection.addEventListener(“login”, eventHandler);

connection.addEventListener(“rosterUpdate”, eventHandler);

connection.addEventListener(“message”, eventHandler);

connection.addEventListener(“disconnection”, eventHandler);

connection.addEventListener(“connection”, eventHandler);

connection.addEventListener(“error”, eventHandler);

roster.addEventListener(“userAvailable”, eventHandler);

roster.addEventListener(“userUnavailable”, eventHandler);


function doLogin() {

_root.mess.text = _root.mess.text*"\r"*“Try to connect”;



Message was edited by:


You do not need to try to load the crossdomain.xml file with LoadVars, or XML.load() in order for the Socket connection to work. It is kind of like a catch 22 the way you have it now: You are trying to test for the loading of the crossdomain XML file, but won’'t be able to load the crossdomain XML file without the crossdomain XML file properly configured to let you load the crossdomain XML. Wow, that is confusing! Flash just does the check for you behind the scenes without you, the programmer, needing to do anything, so in your example this is totally unnecessary.

Can you send an example of what your particular crossdomain file looks like? Is it hosted in the root directory of port 80 on the same machine/domain that is running the XMPP server?

Also, you may want to simplify things at first by creating a crossdomain.xml file that allows any domain to access it. Here is an example of that:

<?xml version="1.0"?>

I hope some of this helps.


Hi thanks, I have taken the test out now but still no luck.

I am trying to access data from jabber.org and I have checked www.jabber.org/crossdomain.xml and from my understanding I should be able to send data their server.

So this is what i have:

A crossdomain xml file on jabber.org which contains:-

A crossdomain xml file on my server which conatins:-

<?xml version="1.0" ?>

I would love to get this working and have tried changing the xml to just about everything i could think of but nothing.

Same problem here, I can connecto from flash but no from my website, anybody has any idea?

the problem, just with jabber.org is in this thread


Note than ETA is Estimated Time of Arribal, the issue is pending. The posta is from jan 5 2005 and still unresolved.