0

I'm using this code to connect Flash CS5 to WebORB:

import flash.display.*;
import fl.events.*;
import flash.events.NetStatusEvent;
import flash.net.*;
import flash.utils.*;
import fl.transitions.*;
//
var connection:NetConnection;
//
function initORB(){
var gateway:String = "http://www.domain.com/weborb30/console/weborb.aspx";
connection=new NetConnection();
connection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
connection.connect(gateway);
}
//
function netStatusHandler(e:NetStatusEvent)
{
    trace("status entered");
}
initORB();

The strange thing is that:

  1. the netStatusHandler function NEVER gets called;
  2. but I can call any orb exposed method (that's not possible if Flash and WebORB are not connected);

The fact is that I want to know if the client is connected too.

Regards, Loto

Loto
  • 1
  • try adding a switch in the `netStatusHandler` and see what happens `function netStatusHandler( e:NetStatusEvent ) { switch( event.info.code ) { case "NetConnection.Connect.Success": trace("status entered"); break; case "NetConnection.Connect.Failed": Alert.show( "Unable to connect to WebORB", "Connection Error" ); break; } }` – phwd Jun 12 '10 at 15:34

1 Answers1

0

I discovered what it was: this API only works with Flash Media Server over RTMP, not HTTP. So, being Flash Remoting over HTTP it does not. Anyway, I think Adobe docs are very confusing here...

Loto
  • 1