[Proto-Scripty] Re: Custom signal

2009-12-08 Thread T.J. Crowder
Hi, You suggested to use: a = [] instead of: a = new Array() What is the difference? It's shorter and does exactly the same thing. Similarly, `{}` is the same as `new Object()`. -- T.J. :-) On Dec 7, 9:43 pm, Frédéric f...@gbiloba.org wrote: On lundi 07 décembre 2009, Tobie

[Proto-Scripty] Re: Custom signal

2009-12-07 Thread fma
I'm not sure it will do what I'm looking for. If I understand, your code will call the same func with all arguments, but one by one. What I want to do is to call each slot with all arguments. Here is an example: function func1(arg1, arg2) { ... } function func2(arg1, arg2) { ... } mySignal =

Re: [Proto-Scripty] Re: Custom signal

2009-12-07 Thread Alex McAuley
script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Monday, December 07, 2009 9:31 AM Subject: [Proto-Scripty] Re: Custom signal I'm not sure it will do what I'm looking for. If I understand, your code will call the same func with all arguments, but one by one. What I want to do is to call each

[Proto-Scripty] Re: Custom signal

2009-12-07 Thread fma
Good! Is it possible to pass again this var to another function? What if I do: function func2(arguments) { ... } function func1() { func2(arguments); } func1(a, b); Does it work? -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us

[Proto-Scripty] Re: Custom signal

2009-12-07 Thread david
Hi fma, If you test exemple you'll gave, it could result in something like that: function func2(arguments) { alert(arguments); alert($A(arguments)); } function func1() { func2(arguments); } func1('a1','b2'); The body of func2 will alert the arguments received, which ius of course

Re: [Proto-Scripty] Re: Custom signal

2009-12-07 Thread Alex McAuley
script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Monday, December 07, 2009 11:53 AM Subject: [Proto-Scripty] Re: Custom signal Good! Is it possible to pass again this var to another function? What if I do: function func2(arguments) { ... } function func1() { func2(arguments

[Proto-Scripty] Re: Custom signal

2009-12-07 Thread T.J. Crowder
- Original Message - From: fma f...@gbiloba.org To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Monday, December 07, 2009 11:53 AM Subject: [Proto-Scripty] Re: Custom signal Good! Is it possible to pass again this var to another function? What if I do

Re: [Proto-Scripty] Re: Custom signal

2009-12-07 Thread Frédéric
Le lundi 7 décembre 2009 12:46, T.J. Crowder a écrit : Worth reading up on the `arguments` variable in the spec[1] (warning, multi-meg PDF). Also check out Function#apply, which is probably what you're looking for: It works fine! Here is the code I now use: var Signal = Class.create({

Re: [Proto-Scripty] Re: Custom signal

2009-12-07 Thread Frédéric
On lundi 07 décembre 2009, Tobie Langel wrote: A couple suggestions: https://gist.github.com/bb3d40f6915118da4dec Thanks! You suggested to use: a = [] instead of: a = new Array() What is the difference? PS: about the try/catch, in my real code, I log the error on Firebug