Anyone want to volunteer to write a simple test case for LPP-2554 and we try to get this feature to work for the upcoming 3.4 release? I added a note to the bug -- the main thing that is preventing moving forward on this front is the lack of an ability to easily test that it works and debug what is going on when it doesn't.

By the way, thanks for pointing out the naming problem, Tucker. We should probably call this remotecall or something...

Sarah


On Mon, Nov 20, 2006 at  9:46 AM, P T Withington wrote:

I know nothing about Red5 or rtmp, but it is probably a bad idea to have a method named `call` since `call` is a standard Javascript property of Function.prototype (and hence of every class constructor). It is entirely possible that the implementation of `apply` depends on the `call` built-in and that by overriding it, you have shot yourself in the foot.

In Javascript:

   fn.call(obj, ...) => obj.fn(...)  // first arg becomes 'this' in fn

fn.apply(obj, [...]) => obj.fn(...) // first arg becomes 'this' in fn, second arg must be an array, and it's contents are 'spread' as the arguments to fn.

At least for me, I can't really parse this code because I can't tell when `call` means `Function.prototype.call` and when it means "remote call".

On 2006-11-20, at 11:39 EST, Sebastian Wagner wrote:

see:


you are right, the calling with the current rtmp-connection does not work.
You have to replace:
   <!--- make a remote call to the rtmp server
todo: we probably don't want to expost the Flash callback object-->
   <method name="call" args="func, obj, params">
if (this.debug) Debug.write("call: func, obj, params",func,obj,
params);
       if (params.length != 0){

           this._nc.call.apply(arguments);

       } else {
           this._nc.call(func, obj);
       }
   </method>

with:
   <!--- make a remote call to the rtmp server
todo: we probably don't want to expost the Flash callback object-->
   <method name="call" args="func, obj, params">
if (this.debug) Debug.write("*#* call: func, obj, params",func,obj,
typeof (params) ,params.length);
       if (params.length != 0){
           //does this really work?
           ASSetPropFlags(_global, null, 8, 1);
           Debug.write("does it work?",arguments);
           <!--
           this._nc.call.apply(this._nc,arguments);
            -->
           if (params.length==1){
               this._nc.call(func, obj,params[0]);
           } else if (params.length==2){
               this._nc.call(func, obj,params[0],params[1]);
           } else if (params.length==3){
this._nc.call(func, obj,params[0],params[1],params[2]);
           } else if (params.length==4){
               this._nc.call(func,
obj,params[0],params[1],params[2],params[3]);
           }
       } else {
           this._nc.call(func, obj);
       }
   </method>

and there is a fix/workaround for invokeing methods from servers side, i've
add i file here:
http://jira.openlaszlo.org/jira/browse/LPP-2554


regards
sebastian wagner


2006/11/20, Daniel Küstner <[EMAIL PROTECTED]>:

Hi,

I'm trying to use Laszlo in connection with Red5 and have some
problems with netremoteall.

netremotecall.call() with no arguments invokes the right method on
the server side. But using an array of two strings as arguments of
the netremotecall.call() does nothing on the server side. What am I
doing wrong?

daniel.




--
Sebastian Wagner
http://www.webbase-design.de
http://www.laszlo-forum.de
Bleichstraße 92
75173 Pforzheim
Tel.: 0177-7341829
Home: 07231-417456
[EMAIL PROTECTED]




Reply via email to