0

I'm using FMS 4.0. I'm trying to use the Remote SharedObject, which I've I used in the past, but nothing seems to work. Even the most simple example doesn't work. No events are triggered on the SO instance (no NetStatusEvent or SyncEvent). No exceptions, no nothing.

import flash.net.NetConnection;
import flash.net.SharedObject;
import flash.events.NetStatusEvent;
import flash.events.AsyncErrorEvent;
import flash.events.SyncEvent;
import flash.utils.Timer;
import flash.events.TimerEvent;

var nc:NetConnection = new NetConnection();
var so:SharedObject;
var url:String = "rtmp://127.0.0.1/live";
var tm:Timer = new Timer(1000);

nc.client = {};

nc.addEventListener(NetStatusEvent.NET_STATUS, function(event:NetStatusEvent):void {
  trace("nc netstatus event", event.info.code);

  if (event.info.code !== "NetConnection.Connect.Success") {
    return;
  }

  so = SharedObject.getRemote("settings", nc.uri, true);
  so.client = {};
  so.addEventListener(AsyncErrorEvent.ASYNC_ERROR, trace);

  so.addEventListener(NetStatusEvent.NET_STATUS, function(event:NetStatusEvent):void {
    trace("so netstatus event", event.info.code);
  });

  so.addEventListener(SyncEvent.SYNC, function(event:SyncEvent):void {
    trace("so synced");
    trace("time", so.data.time);
  });

  so.connect(nc);
  tm.start();
});

tm.addEventListener(TimerEvent.TIMER, function(event:TimerEvent):void {
  trace("tick");
  so.setProperty("time", new Date().toString());
});

nc.connect(url);

I'm using the Developer license, so SharedObjects should work.

Nando Vieira
  • 964
  • 10
  • 17

1 Answers1

0

Your rtmp address is: rtmp://127.0.0.1/live Isn't that a connection to localhost? I think you are supposed to use rtmp:/127.0.0.1/live when you connect to localhost instead of an internet ip address (i.e. use just one slash)

SimonRH
  • 1,409
  • 2
  • 13
  • 23