all groups > macromedia flash flashcom > august 2007 >
You're in the

macromedia flash flashcom

group:

Newbie to FMS 2


Newbie to FMS 2 pwyon
8/23/2007 5:48:51 PM
macromedia flash flashcom:
On Machine A: I have Apache and Flash Media Server 2 Developer Ed.
When I test my app ( called testApp1 ) everything works fine.
But, when I test it on Machine B over the LAN, it hangs for a long time, I
get, NetConnection.Connect.Failed and then the browser crashes. Very annoying.

Any idea what I might be doing wrong? I can post my code if you need to see it
as well.

Thanks in advance for any help!


Re: Newbie to FMS 2 JayCharles
8/24/2007 12:00:00 AM
Perhaps there's a firewall in the way somewhere... either on Machine A, Machine
B, or your router. Try opening port 1935 on your firewalls.

Also, when you connect from machine B, what hostname are you using? The LAN IP
of machine A, or your WAN IP?

Re: Newbie to FMS 2 pwyon
8/24/2007 4:37:30 PM
JayCharles,
Yeah, I have tried messing w/ the firewalls and port 1935 for some time
now. I have had no luck with that at all. The ip im using in code is for
Machine A's LAN IP: 192.168.#.# I've also tried using: rtmp:/testApp1 , and
still no luck. Here's the code that works on Machine A ( which has FMS2 Dev.
and Apache ):

----code below----

import flash.net.NetConnection;
import flash.events.NetStatusEvent;
import flash.events.AsyncErrorEvent;
import flash.events.SecurityErrorEvent;

import flash.events.MouseEvent;
import flash.events.Event;

import flash.net.SharedObject;
import flash.events.SyncEvent;


var nc:NetConnection = new NetConnection();
var so:SharedObject;




//CONNECT======================================================================
===
nc.objectEncoding = ObjectEncoding.AMF0;
//circle_so.objectEncoding = ObjectEncoding.AMF0;

nc.addEventListener( NetStatusEvent.NET_STATUS , netStatusHandler );
nc.addEventListener( AsyncErrorEvent.ASYNC_ERROR , asyncErrorHandler );
nc.addEventListener( SecurityErrorEvent.SECURITY_ERROR , securityErrorHandler
);

nc.connect( "rtmp://192.168.#.#/testApp1" ); //change last two numbers
//my other attempt
//nc.connect( "rtmp:/testApp1" );

function asyncErrorHandler( aee:AsyncErrorEvent ){
StatusText.text = aee.toString();
}//end function

function securityErrorHandler( see:SecurityErrorEvent ){
StatusText.text = see.toString();
}//end function

function netStatusHandler( nse:NetStatusEvent ){
StatusText.text = nse.info.code;
if( nse.info.code == "NetConnection.Connect.Success" ){
light.gotoAndStop( 2 ); //green
so = SharedObject.getRemote( "position" , nc.uri );
so.addEventListener( SyncEvent.SYNC , syncHandler );
so.connect( nc );
}else{
light.gotoAndStop( 1 ); //red
}//end if
}//end function

function syncHandler( se:SyncEvent ){
for( var i:Number = 0 ; i < se.changeList.length ; i++ ){
updateCircle();
}//end for
}//end function

//CONNECT======================================================================
===



//CIRCLE=======================================================================
===
function updateCircle( ){
circle.x = so.data.dx;
circle.y = so.data.dy;
}//end function

circle.addEventListener( MouseEvent.MOUSE_DOWN , mouseDownHandler );
circle.addEventListener( MouseEvent.MOUSE_UP , mouseUpHandler );

function mouseDownHandler( me:MouseEvent ){
circle.startDrag( false );
circle.addEventListener( MouseEvent.MOUSE_MOVE , mouseMoveHandler );
}//end function

function mouseUpHandler( me:MouseEvent ){
circle.stopDrag();
circle.removeEventListener( MouseEvent.MOUSE_MOVE , mouseMoveHandler );
}//end function

function mouseMoveHandler( me:MouseEvent ){
updateSO( circle );
}//end function

function updateSO( mc:MovieClip ){
so.setProperty( "dx" , circle.x );
so.setProperty( "dy" , circle.y );
}//end function

//CIRCLE=======================================================================
===
---end code---

I think that's about it. It's just a simple app where if you move the ball, it
updates in the other browser windows as well.




Re: Newbie to FMS 2 pwyon
8/25/2007 11:26:38 PM
So, no one is going to help? I am still having the problem. And it is driving
me nuts! I am new to this and could really use a point in the right direction.
I've completely turned off both of my firewalls and it still won't work. Is it
something to with this code below?

----code----


nc.connect( "rtmp://192.168.#.#/testApp1" ); //change last two numbers
//my other attempt
//nc.connect( "rtmp:/testApp1" );


----code----
Re: Newbie to FMS 2 Sergio Eurico
8/27/2007 12:13:43 AM
[q][i]Originally posted by: [b][b]pwyon[/b][/b][/i]
So, no one is going to help? I am still having the problem. And it is driving
me nuts! I am new to this and could really use a point in the right direction.
I've completely turned off both of my firewalls and it still won't work. Is it
something to with this code below?

----code----


nc.connect( "rtmp://192.168.#.#/testApp1" ); //change last two numbers
//my other attempt
//nc.connect( "rtmp:/testApp1" );


----code----[/q]

Hi, have you tried to call using the port number 1935?

try this

nc.connect( "rtmp://192.168.#.#:1935/testApp1" );


-- Sergio Eurico

Re: Newbie to FMS 2 pwyon
8/27/2007 8:01:57 PM
Sergio Eurico
Hey. Thanks for the info. I'll surely give it a try. I'll let you know what happens.
I hope it works...

Thanks,
Re: Newbie to FMS 2 pwyon
8/28/2007 9:31:34 PM
Sergio Eurico,
Re: Newbie to FMS 2 flashstreamer
8/31/2007 10:05:53 PM
hi,

I've been tearing my hair out with the same, or very similar problem....

I built a simple flash media app to stream some live audio, which is being
encoded by Flash Media Encoder and published to a Flash Media server on the
same machine, but hosted remotely from my client/player. Basically I want to
make the stream available to Internet users.

I'm serving the html/swf files locally.

When the FMS is hosted in the same LAN as the html/swf files, it all works.
BUT when I take the FMS and host it remotely, the NetConnection fails. Firewall
ports all checked and apparently ok.

I did an Ethereal trace which shows the client making a TCP connection to port
1935 (RTMP) and reaching the server, but the server TCP is returning a TCP RST
(reset).

I haven't tried specifying the port 1935 in the nc.connect(), but will give it
a try. But don't see why it should make a difference given I can see from the
trace my packets are going to TCP port 1935.

The FMS2 documentation does point out that Net.connect will fail if the
html/swf is served from a different domain than the domain the FMS resides. But
having read up more about FM player "sandboxing" it seems the only way to
ensure both client and server are in the same security sandbox is to serve the
html/swf files from the same machine as the FMS2. But then that severely limits
flexibility and is contrary to much of what is described by the documentation
in terms of being able to host the FMS and html/swf on physically different
machines.

Anyone out there with any clues??

thanks in advance!
Re: Newbie to FMS 2 farhanshahid90
9/2/2007 2:44:54 PM
Hi all,

i am having the same problem of streaming flv file over internet.
I am tryng to stream an flv file over internet.
i have followed each and every step from the following tutorial:
http://www.mcalister.cc/ddd/flv/index.html
and when i run the html page on LAn, my flv file is streamng perfectly, but
when try to run the same html file from the internet i dont see anything on the
page except for the box of flash player.

can any 1 tell me why my FLV file is working on LAN only. Why it is not
working from internet, although ive no firwall problem on the FMS2 AND IIS
machine?
AddThis Social Bookmark Button