Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Sample apps not working

6 views
Skip to first unread message

mbd

unread,
Apr 17, 2006, 4:02:14 PM4/17/06
to
I just downloaded FMS 2.0.1 today and installed on my Win2K dev machine. I just
want to start testing.

After reading up in the docs about how to connect to the server and being
unsuccessful in doing so, I downloaded the samples from the Macromedia site. I
unzipped and placed the samples and applications folders in the FMS
installation directory.

I can connect through the server admin console.

The problem is that most of the sample apps don't work. I wanted to look at
the sample_guestbook app since it seems pretty simple. When I launch the SWF in
either the standalone player or in the browser (from the provided HTML file)
nothing happens. I then opened the FLA and published but I get a trace of
"Unable to connect".

When I try the sample_lobby SWF it works. The problem with that is the
connection process is a lot more complicated since it's using components.

I tried my own FLA but it won't work:

var nc = new NetConnection();
nc.onStatus = function(info)
{
trace(info.code);
}
nc.connect('rtmp:/tutorial_text/room_01');

I always get NetConnection.Connect.Failed

I also tried:
nc.connect('rtmp://127.0.0.1:1935/tutorial_text/room_01');
to no avale.

I then looked at tutorial_text, which is also pretty simple, but I can't
publish it since I don't have NetDebug.as. Why is that not installed?

Sorry for the newbie questions, but starting out with FMS has been
frustrating. Is there a beginner's guide or something? I don't mean
installation - I got that. I mean a "Now that you've installed FMS, here's an
FLA and associated files, and here's where to put it, and it should work". The
samples just don't do that.

I think a simple tutorial from Macromedia in this regard would do wonders in
getting people hooked on FMS.

In case it matters, I don't have a web server running on my system and my
firewall software is off.


mbd

P.S. In case any Adobe people actually look at this board, providing a link to
a Documentation folder where files are named flashmediaserver_cs_asd.pdf is
very wrong. It's like mystery-meat-navigation for files: open this one... nope.
this one? nope. sigh. How about a link called "Client-Side ActionScript
Language Reference"?

mbd

unread,
Apr 19, 2006, 10:32:25 AM4/19/06
to
Am I really the only one that can't get the samples, and even the most basic code, to work?

Can anyone shed some light on why this might be happening? Anything at all?


mbd

JayCharles

unread,
Apr 19, 2006, 1:28:22 PM4/19/06
to
If the swf is on the same machine as fms, try this:

nc.connect('rtmp://localhost:1935/tutorial_text/room_01');

If the .swf is on another machine on your network, try this:

nc.connect('rtmp://FMS_LAN_IP:1935/tutorial_text/room_01'); <- insert the LAN
ip of your FMS machine

If the .swf is connecting to your FMS server from elsewhere (prehaps the
internet) try:

nc.connect('rtmp://FMS_WAN_IP:1935/tutorial_text/room_01'); <- Insert your
internet (WAN) ip

On the FMs machine, make sure you don't have a firewall preventing connections
to FMS.

mbd

unread,
Apr 19, 2006, 2:09:03 PM4/19/06
to
Hi Jay,

Thanks for the response.

Here's my code:

var nc = new NetConnection();

nc.onStatus = function(info)
{
trace(info.code);
}

nc.connect('rtmp://localhost:1935/tutorial_text/room_01');

Trace output:
NetConnection.Connect.Rejected
NetConnection.Connect.Closed

My firewall software is disabled.

I'm on Windows 2000.

The FMS is on the same machine that I'm trying the code.

If nothing seems obvious about this then perhaps it's something basic that I
didn't do, or am not doing, in the server console. Is there anything that I
need to do there?

TIA, I appreciate the time.


Derek Vadneau

JayCharles

unread,
Apr 19, 2006, 2:45:59 PM4/19/06
to
Now we're getting somewhere. The following output:

NetConnection.Connect.Rejected
NetConnection.Connect.Closed

Tells you that the .swf found the server and tried to log in, but the server
rejected the connection. That's a good thing... as it means your FMS
installation is working and your firewall isn't getting in the way.

I haven't used any of the sample apps, but I would imagine they are looking
for some parameters in the connect argument... perhaps a username? Look at
main.asc in the application directory and see what it's looking for in the
application.onConnect function.

mbd

unread,
Apr 19, 2006, 3:31:47 PM4/19/06
to
Ok, someone from Adobe has really GOT to go through and update the samples they
post on their site. There is no application folder for the tutorial_text
sample, so no main.asc file. Arg. I assume that would be why it won't work.

However, it isn't the only sample that doesn't work.

Here's one that does have an application folder:
Sample - tutorial_hello


Contains two textfields, one named User, the other Message. Also contains a
button named Connect_btn.


// Must be commented out since it isn't included with FMS.
//#include "NetDebug.as"

stop();

// Open connection to the server
client_nc = new NetConnection();

// Handle status message
client_nc.onStatus = function(info) {
trace("Level: " + info.level + newline + "Code: " + info.code);
}

// Event handler for Connect_Btn
function doConnect() {

// If user wants to connect...
if (Connect_btn.getLabel() == "Connect") {

// Connect to the hello application
client_nc.connect("rtmp://localhost:1935/tutorial_hello/room_01", User.text);

// Update button label
Connect_btn.setLabel("Disconnect");

// If user wants to disconnect...
} else if (Connect_btn.getLabel() == "Disconnect") {

// Close connection
client_nc.close();

// Reset button label
Connect_btn.setLabel("Connect");

// Reset the text fields
user.text = "";
message.text = "";

}
}

// Callback function server calls to send message back to
// this client.
client_nc.msgFromSrvr = function(msg) {

var msg;
_root.Message.text = msg;

}


application.onConnect = function(newClient, name) {

// Give this new client the same name as the user name
newClient.name=name;

// Accept the new client's connection
application.acceptConnection(newClient);

// Create a customized "Hello " message
// that the server will send to the client
var msg = "Hello! You are connected as: " + newClient.name;

// Print out status message in the application console
trace("Sending this message: " + msg);

// Call the client function, 'message,' and pass it the 'msg'
newClient.call("msgFromSrvr", false, msg);
}


When I publish/test this example, I enter my name, click the Connect button,
and I get this in the trace output:
Level: error
Code: NetConnection.Connect.Failed

Sorry to change to another example but I didn't have much of a choice. Are we
back to square one?

I feel like an idiot because I realize many other people have this working.


Thanks,

Derek Vadneau

JayCharles

unread,
Apr 19, 2006, 4:08:08 PM4/19/06
to
Do you add the application folder to your FMS applications directory?

mbd

unread,
Apr 19, 2006, 4:19:55 PM4/19/06
to
Yes. After I unzipped the samples I moved the whole applications directory into
the FMS install directory:
C:\Program Files\Macromedia\Flash Media Server 2\applications

The applications\tutorial_hello\main.asc file is actually in:
C:\Program Files\Macromedia\Flash Media Server
2\applications\tutorial_hello\main.asc

I can see the application from the admin console as tutorial_hello, under
Manage Servers > Applications.

I also copied the samples directory into:
C:\Program Files\Macromedia\Flash Media Server 2\samples
(where the FLA resides)

I realize I didn't need to do this but it seemed as good a place as any.


Derek Vadneau

Lex Prozee

unread,
Apr 20, 2006, 3:53:49 PM4/20/06
to
I have exactly the same problem. I can also connect as administrator on port
1111.
nc=new NetConnection();
nc.onStatus=function(info){
trace(info.code);
};
nc.connect("rtmp://localhost:1111","administrator","password");
NetConnection.Connect.Succesful

but when I want to connect with :
nc=new NetConnection();
nc.onStatus=function(info){
trace(info.code);
};
nc.connect("rtmp:/helloVideo", "lex");

I received: NetConnection.Connect.Failed
the admin console is working.
I already tried rtm://localhost:1935/helloVideo","lex", but I get the same
results.

Is it possible that it had to do with more than 1 ethernet card in de computer?


mbd

unread,
Apr 20, 2006, 4:22:33 PM4/20/06
to
I don't have more than one ethernet card, so I can't say if that's what's
happening in your case or not.

Thanks for posting your issue. Perhaps it'll get a little more attention if
more people that are having the issue post about it.

I don't mean to knock Jay's efforts here - he seems to be very active in
helping out on the forums.

Maybe if we can find a commonality it'll help us narrow down the issue.

Are you using Windows 2000, XP, 98?

I have Flash MX, MX 2004, and 8 installed. I also have Flex Builder 2 Beta 1
installed (although not running during FMS testing).

I have tried the code I posted in Flash MX and in Flash 8 with the same
results.

The FMS processes are all running:
FMSAdmin.exe
FMSCore.exe
FMSCore.exe
FMSEdge.exe
FMSMaster.exe
(at least I think that's all of them)

I can't think of anything else relevant at the moment.

Lex Prozee

unread,
Apr 20, 2006, 7:08:29 PM4/20/06
to
I'm running Windows XP SP2. I try to uninstall all the antivirus software and
al the hitmanpro etc. but this is also no solution.
What I see in de logfile Core.00 is this error?


2006-04-21 01:01:50 4620 (w)2631008 Asynchronous I/O operation failed (Failed
to attach to completion port: De parameter is onjuist. 87). -

2006-04-21 01:01:50 4620 (w)2631008 Asynchronous I/O operation failed (Failed
to attach to completion port: De parameter is onjuist. 87). -

2006-04-21 01:01:50 4620 (w)2631008 Asynchronous I/O operation failed (Failed
to attach to completion port: De parameter is onjuist. 87). -

2006-04-21 01:01:51 4620 (w)2631008 Asynchronous I/O operation failed (Failed
to attach to completion port: De parameter is onjuist. 87)

JayCharles

unread,
Apr 20, 2006, 7:15:09 PM4/20/06
to
Originally posted by: Lex Prozee

I have exactly the same problem. I can also connect as administrator on port
1111.


When you connect to port 1111, you're not connecting to the FMS service,
you're connecting to the FMS admin service. Have you tried starting an
application from the admin console? If so, what are the results?

JayCharles

unread,
Apr 20, 2006, 7:24:21 PM4/20/06
to
Originally posted by: mbd

When I publish/test this example, I enter my name, click the Connect button,
and I get this in the trace output:
Level: error
Code: NetConnection.Connect.Failed

You get this error when you run the .swf on the same machine FMS is installed
on, using localhost as the domain?

mbd

unread,
Apr 20, 2006, 9:44:57 PM4/20/06
to
You get this error when you run the .swf on the same machine FMS is installed
on, using localhost as the domain?
Yes. I ran the code from Flash 8 (originally in MX) on the same PC that FMS is
installed and running. The code I gave is exactly what I ran.

This line:


client_nc.connect("rtmp://localhost:1935/tutorial_hello/room_01", User.text);

was altered from the original:
client_nc.connect("rtmp:/tutorial_hello/room_01", User.text);
which was in the original sample, and also had the same result.


Derek Vadneau

mbd

unread,
Apr 25, 2006, 12:55:32 PM4/25/06
to
I created a new app/folder called testApp and placed this in the main.asc file:

application.onAppStart = function()
{
trace("Test App Starting");
}

application.onConnect = function(client)
{
trace("Connecting Client");
}

I then used this on the client:


var nc = new NetConnection();
nc.onStatus = function(info)
{
trace(info.code);
}

var r = nc.connect('rtmp://localhost:1935/testApp');
trace(r);

The trace output is:
true
NetConnection.Connect.Failed

In the Server Log section of the admin console I see:
Asynchronous I/O operation failed (Failed to attach to completion port: The
parameter is incorrect. 87).

Not sure if this is relevant or not.

And in case someone can see something from this, here are the lines from my
log files after the connection attempt:
edge.00.log
2006-04-25 12:31:57 2436 (i)2581252 Registering core (1500). -

master.00.log
2006-04-25 12:31:56 2064 (i)2581221 Core (1500) started, arguments : -adaptor
"_defaultRoot_" -vhost "_defaultVHost_" -app -inst -conf "C:\Program
Files\Macromedia\Flash Media Server 2\conf\server.xml" -name
"_defaultRoot_:_defaultVHost_::". -

admin.00.log
2006-04-25 12:31:57 632 (i)2581243 Connection from core 1500 received. -
2006-04-25 12:31:57 632 (i)2581244 Connection from core 1500 accepted. -

core.00.log
2006-04-25 12:31:57 1500 (i)2581237 Starting admin app on core (1500). -
2006-04-25 12:31:57 1500 (i)2581238 Core (1500) connecting to admin. -
2006-04-25 12:31:57 1500 (i)2581231 Core (1500) connected to admin. -
2006-04-25 12:31:57 1500 (i)2581246 Core (1500) sending register cmd to edge. -
2006-04-25 12:31:57 1500 (w)2631008 Asynchronous I/O operation failed (Failed
to attach to completion port: The parameter is incorrect. 87). -
2006-04-25 12:31:57 1500 (i)2581234 Core (1500) connection to admin accepted. -
2006-04-25 12:32:32 1500 (w)2631008 Asynchronous I/O operation failed (Failed
to attach to completion port: The parameter is incorrect. 87).


Derek Vadneau

sahinkardas

unread,
Sep 5, 2009, 2:36:58 AM9/5/09
to

sahinkardas

unread,
Sep 5, 2009, 2:37:12 AM9/5/09
to
port
0 new messages