yes ptw, the way that you pointed is simplier. I just wanted to learn the script way to implement handler.
2010/2/24 P T Withington <[email protected]> > Adding a handler (or a constraint) in script is complicated. > > The easiest way to do what you want is to subclass button, so you can write > your handler code in LZX: > > <class name="mybutton" onclick="Debug.info("room url : %w")" /> > > then say: > > ... = new lz.mybutton(canvas, {text: roomName, xoffset: -20}); > > This is just the way LZX is. Some of the advanced features, that are > simple in LZX, actually turn into a lot of Javascript, that makes them not > so simple in script. > > If you ever want to see what Javascript is generated by a certain LZX > construct, you can call `lzc -S` to see the intermediate Javascript before > it is compiled to the target platform. It's not pretty, but it can be > helpful if you _really_ have to do something in script, to see what you need > to do. > how do i learn the parameter options for lzc. I often use the developer console for the compilation. Thanks Cem > > On 2010-02-23, at 16:59, cem sonmez wrote: > > > hi all. I am trying to implement the onclick handler of the button that i > am > > creating with lz. namespace. > > When i use the way below, i see the debug message while the button is > being > > created(isnT it weird ?) and when i click the button, getting this error > on > > the debugger : > > > > ERROR @views/LaszloView.lzs≈2684: ReferenceError: Error #1069: could not > > find ready property on LzInfo and no default value... > > > > <attribute name="room1" value="null"/> > > <method name="createRoom" args="roomName"> > > var url = URL.text; > > room1= new lz.button(canvas, { > > text : roomName, > > xoffset : -20, > > onclick : Debug.info("room url : %w") > > }); > > </method> > > > > And another important question, am i trying the right way to implement > the > > onclick handler in this way :) > > Kind regards > > > > -- > > Cem SONMEZ > > -- Cem SONMEZ
