Macromedia Flash Server - Shared object

This is Interesting: Free IT Magazines  
Home > Archive > Macromedia Flash Server > April 2005 > Shared object





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Shared object
Simon Lord

2005-04-07, 5:50 pm

The following server side script appears to work but complains that
"client.call" is not a function:

Client.prototype.runCounter = function(client) {
trace(client+" at "+client.ip+" has connected");
nextIP = client.ip;
if (nextIP != lastIP) {
nextCount = counterSO.getProperty("count")+1;
counterSO.setProperty("count", nextCount);
lastIP = client.ip;
} else {
nextCount = counterSO.getProperty("count");
}
client.call("setCounter", null, nextCount);
};

..... two things, 1) the client.ip traces out as undefined and 2)
"client.call" is not a function. The second point makes for sending
the SO info to a specific user quite difficult. I know how to blanket
the entire room with a message, but I thought this was the proper way
to do it. When I trace(client) I get "simon" so I know the person
requesting the SO info, why can't I call them back?

simon at undefined is number 14 to date
line 12: TypeError: client.call is not a function
Failed to execute method (runCounter).

Sincerely,
Simon


=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm

Brian Lesser

2005-04-07, 5:50 pm

Hi Simon,
It looks like you are just passing in a string to the function not an
actual client object. The problem is with the calling code.
Yours truly,
-Brian

Simon Lord wrote:

> The following server side script appears to work but complains that
> "client.call" is not a function:
>
> Client.prototype.runCounter = function(client) {
> trace(client+" at "+client.ip+" has connected");
> nextIP = client.ip;
> if (nextIP != lastIP) {
> nextCount = counterSO.getProperty("count")+1;
> counterSO.setProperty("count", nextCount);
> lastIP = client.ip;
> } else {
> nextCount = counterSO.getProperty("count");
> }
> client.call("setCounter", null, nextCount);
> };
>
> .... two things, 1) the client.ip traces out as undefined and 2)
> "client.call" is not a function. The second point makes for sending
> the SO info to a specific user quite difficult. I know how to blanket
> the entire room with a message, but I thought this was the proper way
> to do it. When I trace(client) I get "simon" so I know the person
> requesting the SO info, why can't I call them back?
>
> simon at undefined is number 14 to date
> line 12: TypeError: client.call is not a function
> Failed to execute method (runCounter).
>
> Sincerely,
> Simon
>
>
> =-----------------------------------------------------------
> Supported by Fig Leaf Software - http://www.figleaf.com
> =-----------------------------------------------------------
>
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm




=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm

Simon Lord

2005-04-07, 5:50 pm

Tah dahhh! Brian (or anyone), is the following the accepted approach
or was there a faster client side solution to passing the user info (I
kept sending strings as Brian mentioned but it's pretty much all I know
from client side).

Client.prototype.runCounter = function(client) {
for (var i=0; i<application.clients.length; i++) {
if (gFrameworkFC.getClientGlobals(application.clients[i]).username ==
client) {
var nextIP = application.clients[i].ip;
if (nextIP != lastIP) {
nextCount = counterSO.getProperty("count")+1;
counterSO.setProperty("count", nextCount);
lastIP = client.ip;
} else {
nextCount = counterSO.getProperty("count");
}
application.clients[i].call("setCounter", null, nextCount);
trace(client+" at "+nextIP+" is number "+nextCount+" to date");
}
}
};




On Feb 24, 2005, at 10:31 PM, Brian Lesser wrote:

> Hi Simon,
> It looks like you are just passing in a string to the function not an
> actual client object. The problem is with the calling code.
> Yours truly,
> -Brian
>
> Simon Lord wrote:
>
>
>
>
> =-----------------------------------------------------------
> Supported by Fig Leaf Software - http://www.figleaf.com
> =-----------------------------------------------------------
>
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>
>

Sincerely,
Simon


=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com