It took me a while to figure this out, but since Flash has a lot of Sandbox issues, a chat client created in Flex will not connect to your jabber server if the sandbox type is anything other than LocalTrusted (correct me if I am missing some exceptions). One possible way to fix this is to install a webserver, such as Tomcat or IIS on your chat server, and stick a crossdomain.xml file in the root.
It does not need to be in the root though, and if it is not, you will need to define in your flex code where it is with:
Security.loadPolicyFile(“location-of-crossdomain.xml”);
Make sure that line of code is executed during the initialize event of the Application. Something like:
<?xml version=“1.0” encoding=“utf-8”?>
<mx:Application xmlns:mx=“http://www.adobe.com/2006/mxml”
layout=“vertical” width=“100%” height=“100%”
initialize=“init()”>
<mx:Script>
<![CDATA[
import flash.system.Security;
public function init():void{
Security.loadPolicyFile(“http://wmc02/crossdomain.xml”);
}