Permalink
Browse files

heartbeat functional for subscribe operation

  • Loading branch information...
1 parent 8d84149 commit 936714e8329789367d3f71a405bd16eae48ea153 @fmaxx fmaxx committed Oct 24, 2012
View
@@ -14,3 +14,5 @@ node_modules
/csharp/*/PubNub-Messaging*/bin/*
/csharp/*/PubNub-Messaging*/obj/*
/j2me/3.3/nbproject
+/flash/3.3.1beta/obj/*.old
+/flash/3.3.1beta/obj/PubNubTestConfig.xml
@@ -8,12 +8,12 @@
<fx:Script>
<![CDATA[
import com.pubnub.*;
- import com.pubnub.events.*;
import flash.events.*;
import flash.external.*;
[Bindable]
- public var channel:String = 'hello_world';
+ public var channel:String = 'my_snz';
+ //public var channel:String = 'hello_world';
[Bindable]
public var origin:String = 'pubsub.pubnub.com';
@@ -43,17 +43,17 @@
secret_key:this.secret_key,
cipher_key:this.cipher_key
}
-
+ //stage.addEventListener(Event.ACTIVATE, onActivate);
+ //stage.addEventListener(Event.DEACTIVATE, onDeactivate);
+
Pn.instance.addEventListener(PnEvent.INIT, onInit);
Pn.instance.addEventListener(PnEvent.INIT_ERROR, onInitError);
Pn.instance.addEventListener(PnEvent.SUBSCRIBE, onSubscribe);
Pn.instance.addEventListener(PnEvent.DETAILED_HISTORY, onDetailedHistory);
Pn.instance.addEventListener(PnEvent.PUBLISH, onPublish);
Pn.init(config);
}
-
-
-
+
private function onInit(e:PnEvent):void {
callExternalInterface("console.log", ("Pn init : " + Pn.instance.sessionUUID));
}
@@ -85,7 +85,7 @@
break;
case OperationStatus.ERROR:
- callExternalInterface("console.log", ("Subscribe [ERROR] : " + e.channel));
+ callExternalInterface("console.log", ("Subscribe [ERROR] : " + e.channel + ', ' + e.data));
break;
}
}
Oops, something went wrong.

0 comments on commit 936714e

Please sign in to comment.