Actionscript 3.0

Creating Tringme Widget

I have to trying to create a flash widget to enable call/voicemail using TringMe api, success was eluding me for quite some time. Finally I was able to make the widget working, I have the code for people who would like to develop similar widgets using TringMe.

var randomstreamname = "63e457425defb24e8a5ca80de80d";
var tringMeURL:String = "rtmp://"; ///uid obtained from TringMe

NetConnection.defaultObjectEncoding =;
var nc:NetConnection;

//Call and close buttons
call_btn.addEventListener(MouseEvent.CLICK, callHandler, false, 0, true);
close_btn.addEventListener(MouseEvent.CLICK, closeCallHandler, false, 0, true);

function callHandler(evt:MouseEvent):void{
nc = new NetConnection();
nc.addEventListener(NetStatusEvent.NET_STATUS, connectionStatushandler, false, 0, true);

function closeCallHandler(evt:MouseEvent):void{

function connectionStatushandler(evt:NetStatusEvent):void{
var info:Object =;

status_txt.text = String(info.code);

if (info.code == "NetConnection.Connect.Success") {

var nsc:NetStream = new NetStream(nc);
var mic:Microphone = Microphone.getMicrophone();
mic.rate = 8;

nsc.publish(randomstreamname, "record");

var nsc1:NetStream = new NetStream(nc);"tring", -1);

Hope this helps some one…

Disclaimer: All published content views of author.