# Actionscript for fms

**URL:** <https://forum.kirupa.com/t/actionscript-for-fms/329093>\
**Category:** Uncategorized\
**Created:** [July 19, 2012, 6:37pm UTC](https://forum.kirupa.com/t/actionscript-for-fms/329093 "2012-07-19T18:37:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![quest20](https://avatars.discourse-cdn.com/v4/letter/q/a87d85/32.png) [@quest20](https://forum.kirupa.com/u/quest20)\
**Post date:** [July 19, 2012, 6:37pm UTC](https://forum.kirupa.com/t/actionscript-for-fms/329093/1 "2012-07-19T18:37:54Z")

</div>

I want to create a live chat between two people.I use hosting a company. I created an application called mytestone. I have edited the main asc file. I think i typed everything in correctly maybe my rtmp url is incorrect? Because i went into my admin console and clicked connect and nothing appeared.  
Anyway, i have copy and pasted my asc file below: I am new to actionscript so please tell me if i made any errors.

var nc.connect("NetConnection = new NetConnection();  
nc.connect(“rtmp://fmsserver272.rtmphost.com/mytestone”);  
//setup the camera and mic for streaming  
mycam = Camera.get();  
mycam\_audio = Microphone.get();  
//control the cameras mode and quality  
mycam.setMode(320,240,30);  
mycam.setQuality(10000,100);  
//attach a vlive preview of the camera to the  
//video object that is setup on the stage  
cam\_feed.attachVideo(mycam);  
cam\_feed.attachAudio(mycam\_audio);  
//connect to the Flash Media Server  
client\_nc = new NetConnection();  
client\_nc.connect(“rtmp://fmsserver.rtmphost.com/mytestone”);  
cam\_ns = new NetStream(client\_nc);  
//attach our camera video and audio to the net stream  
cam\_ns.attachVideo(mycam);  
cam\_ns.attachAudio(mycam\_audio);  
//publish to our Flash Media Server as a  
//live stream called user\_1  
cam\_ns.publish(“user\_1”, “live”);  
//bring in user\_2’s video/audio  
in\_ns = new NetStream(client\_nc);  
in\_ns.play(“user\_2”);  
//attach user\_1’s published audio and video  
//so we can see them in the larger chat window  
live\_feed.attachVideo(in\_ns);  
live\_feed.attachAudio(in\_ns);  
//setup the camera and mic for streaming  
mycam = Camera.get();  
mycam\_audio = Microphone.get();  
//control the cameras mode and quality  
mycam.setMode(320,240,30);  
mycam.setQuality(10000,100);  
//attach a live preview of the camera to the  
//video object that is setup on the stage  
cam\_feed.attachVideo(mycam);  
cam\_feed.attachAudio(mycam\_audio);  
//connect to the Flash Media Server  
client\_nc = new NetConnection();  
client\_nc.connect(“rtmp://fmsserver.rtmphost.com/mytestone”);  
cam\_ns = new NetStream(client\_nc);  
//attach our camera video and audio to the net stream  
cam\_ns.attachVideo(mycam);  
cam\_ns.attachAudio(mycam\_audio);  
//publish to our Flash Media Server as a  
//live stream called user\_2  
cam\_ns.publish(“user\_2”, “live”);  
//bring in user\_1’s video/audio  
in\_ns = new NetStream(client\_nc);  
in\_ns.play("user\_1’s);  
//attach user\_1’s published audio and video  
//so we can see them in the larger chat window  
live\_feed.attachVideo(in\_ns);  
live\_feed.attachAudio(in\_ns);
