Skip to content

Commit e1085bc

Browse files
author
Jake Hilton
committed
Added some more netconnection constants to align with Adobes published list.
1 parent f2ba700 commit e1085bc

3 files changed

Lines changed: 12 additions & 8 deletions

File tree

README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,23 +46,20 @@ For example:
4646

4747
```ActionScript
4848
var client_obj:Object = new Object();
49-
client_obj.serverMethod = function(e:Object):void
50-
{
49+
client_obj.serverMethod = function(e:Object):void{
5150
trace("server can call this");
5251
}
5352
5453
var ncs:NetConnectionSmart = new NetConnectionSmart();
5554
ncs.client = client_obj;
5655
ncs.encrypted = true; //if this isn't specified it will default to rtmp/rtmpt.. if true it will try rtmpe/rtmpte
5756
58-
ncs.addEventListener(NetStatusEvent.NET_STATUS,function(e:NetStatusEvent):void
59-
{
57+
ncs.addEventListener(NetStatusEvent.NET_STATUS,function(e:NetStatusEvent):void{
6058
trace("connection status: "+e.info.code);
6159
trace(ncs.uri);
6260
trace(ncs.protocol);
6361
64-
switch (e.info.code)
65-
{
62+
switch (e.info.code){
6663
case NetConnectionSmart.NETCONNECTION_CONNECT_SUCCESS:
6764
var ns:NetStream = new NetStream(ncs.connection);
6865
//do other netstream actions

bin/netconnectionsmart.swc

270 Bytes
Binary file not shown.

src/com/gearsandcogs/utils/NetConnectionSmart.as

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,16 +121,23 @@ package com.gearsandcogs.utils
121121

122122
public class NetConnectionSmart extends EventDispatcher
123123
{
124+
//noinspection JSUnusedGlobalSymbols
125+
public static const NETCONNECTION_CALL_BadVersion:String = "NetConnection.Call.BadVersion";
126+
public static const NETCONNECTION_CALL_FAILED:String = "NetConnection.Call.Failed";
127+
public static const NETCONNECTION_CALL_PROHIBITED:String = "NetConnection.Call.Prohibited";
128+
public static const NETCONNECTION_CONNECT_APPSHUTDOWN:String = "NetConnection.Connect.AppShutdown";
124129
public static const NETCONNECTION_CONNECT_CLOSED:String = "NetConnection.Connect.Closed";
125130
public static const NETCONNECTION_CONNECT_FAILED:String = "NetConnection.Connect.Failed";
131+
public static const NETCONNECTION_CONNECT_IDLETIMEOUT:String = "NetConnection.Connect.IdleTimeOut";
132+
public static const NETCONNECTION_CONNECT_INVALIDAPP:String = "NetConnection.Connect.InvalidApp";
126133
public static const NETCONNECTION_CONNECT_NETWORKCHANGE:String = "NetConnection.Connect.NetworkChange";
127-
//noinspection JSUnusedGlobalSymbols
128134
public static const NETCONNECTION_CONNECT_REJECTED:String = "NetConnection.Connect.Rejected";
129135
public static const NETCONNECTION_CONNECT_SUCCESS:String = "NetConnection.Connect.Success";
130136
public static const NETCONNECTION_PORT_TEST_COMPLETE:String = "NetConnection.PortTest.Complete";
131137
public static const NETCONNECTION_PORT_TEST_UPDATE:String = "NetConnection.PortTest.Update";
132138
public static const NETCONNECTION_RECONNECT_FAILED:String = "NetConnection.Reconnect.Failed";
133139
public static const NETCONNECTION_RECONNECT_INIT:String = "NetConnection.Reconnect.Init";
140+
134141
public static const PARAM_EVT:String = "NetConnectionSmartMsgEvent";
135142
public static const PROXYTYPE_BEST:String = "best";
136143
public static const PROXYTYPE_CONNECT:String = "CONNECT";
@@ -140,7 +147,7 @@ package com.gearsandcogs.utils
140147
public static const RTMFP:String = "rtmfp";
141148
public static const RTMP:String = "rtmp";
142149
public static const RTMPT:String = "rtmpt";
143-
public static const VERSION:String = "NetConnectionSmart v 1.9.0";
150+
public static const VERSION:String = "NetConnectionSmart v 1.9.1";
144151

145152
/**
146153
* Boolean to determine if a unique alphanumeric string should be passed at the end of the param set to the media server

0 commit comments

Comments
 (0)