So far I have successfully connection to Flash Communication Server using Flex 2.0 Alpha Standalone, but when I try to call an Admin API method, I get no response. Here is what I am doing:
<mx:Script>
<![CDATA[
import flash.net.*;
public var adminConnection:NetConnection;
public var serverStatsResponder:Responder;
public function init()
{
adminConnection = new NetConnection();
configureListeners(adminConnection);
adminConnection.connect(null,"127.0.0.1:1111", "myusername", "mypass");
}
public function
configureListeners(dispatcher:IEventDispatcher):Void {
dispatcher.addEventListener(NetStatusEventType.NET_STATUS, onNetStatus);dispatcher.addEventListener(SecurityErrorEventType.SECURITY_ERROR, onSecurityError);
}
public function onNetStatus(event:NetStatusEvent):Void {
switch(event.info.code) {case "NetConnection.Connect.Success" :trace("****connected****");monitorServer();break;
}
trace("onNetStatus: " + event);
var info:Object = event.info;for(var i:String in info) {trace(i + " : " + info[i]);}
}
public function handleServerStatsResult(event:NetStatusEvent) {
trace("handleServerStatsResult: " + event);var info:Object = event.info;for(var i:String in info) {trace(i + " : " + info[i]);}
}
public function handleServerStatsStatus(event:NetStatusEvent) {
trace("handleServerStatsStatus: " + event);var info:Object = event.info;for(var i:String in info) {trace(i + " : " + info[i]);}
}
public function monitorServer() {
serverStatsResponder = new Responder(handleServerStatsResult, handleServerStatsStatus);adminConnection.call("getServerStats", serverStatsResponder);
}
public function onSecurityError(event:SecurityErrorEvent):Void {
trace("onSecurityError: " + event);
}
]]>
</mx:Script>
Yahoo! Photos
Ring in the New Year with Photo Calendars. Add photos, events, holidays, whatever.
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
Web site design development | Computer software development | Software design and development |
Macromedia flex | Software development best practice |
YAHOO! GROUPS LINKS
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.