A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: NetConnection

  1. #1
    Senior Member joshstrike's Avatar
    Join Date
    Jan 2001
    Location
    Alhama de Granada, España
    Posts
    1,136

    NetConnection

    Hey...does anyone know the answer to this?

    in the PHPAccess class:
    this.rs = new NetConnection();

    in the PHPCall class:
    phpAccessInstance.rs.addEventListener(NetStatusEve nt.NET_STATUS,this.gotStatus,false,0,true);
    phpAccessInstance.rs.call.apply(this, dataArray);

    After the call is made, the NET_STATUS event works perfectly in a local sandbox, but doesn't work at all when trying it online in a browser. Is there some kind of security protocol about this? Since the listener is pointed to a function in the PHPCall class, and the PHPCall class is the owner of the call() function thanks to the apply(this,[]), why wouldn't it trigger the NetStatusEvent?

    Thanks!
    Josh

  2. #2
    Senior Member joshstrike's Avatar
    Join Date
    Jan 2001
    Location
    Alhama de Granada, España
    Posts
    1,136
    Can't anybody think of a reason that a NetStatusEvent would dispatch a NetConnection.Status.Failed in the local sandbox, running against a server-side script, but not dispatch the same error when running in a browser?
    For the moment I've been forced to use a timer to see if the result came back or failed -- this is not optimal, at all, since it creates a potential for "thread races" of a kind.
    The point of all this is to check if an AMFPHP call failed and give the user time to reconnect before repeating the call. This is a nice new behavior I'm building into my PHPRemoting package... at http://www.joshstrike.com/strike_remoting.zip
    which in effect will make it stable enough to use for building multiplayer games, etc. ...
    Josh

  3. #3

  4. #4
    Senior Member joshstrike's Avatar
    Join Date
    Jan 2001
    Location
    Alhama de Granada, España
    Posts
    1,136
    Yeah, the call may or may not be going across domains (depending on if it's accessed through the www subdomain)...but I have allowDomain set for all possibilities. The weird thing is that the connection works fine, but the errors don't dispatch as they should.

  5. #5
    if($<0){WelcomeToMyWorld} joshchernoff's Avatar
    Join Date
    Jul 2005
    Location
    Portland
    Posts
    321
    crossdomain.xml file maybe needed or double check your sandbox and make sure network only is set not localdisk. Plus with flash player 9,0,115,0 there is some new things you may want to set in your crossdomain.xml file like "site-control permitted-cross-domain-policie"

  6. #6
    Senior Member joshstrike's Avatar
    Join Date
    Jan 2001
    Location
    Alhama de Granada, España
    Posts
    1,136
    Thanks again, Josh. This was part of the effort to get the my remoting package to retry on failure. I'm just using a timer now, and it's working pretty well...it wasn't the networking in the embed or the crossdomain, though, those were both solid...if you want to try for yourself, just check out the NetConnection.Status.Failed switch in the NetStatusEvent listener in PHPCall... if you can make it trigger that event remotely, upon failure of a call, let me know...my fear is that it has to do with the way I make the NetConnection.call on the PHPAccess NetConnection through an .apply command in PHPCall. I think it thinks its client is PHPAccess, not PHPCall, and that probably means the whole structure of the package would have to be altered...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center