Hi Eduardo,
The officially supported way to do this is with one or more
lzSetCanvasAttribute() calls. The lzSetCanvasAttribute(name, value)
browser javascript API causes a canvas attribute to be set to a new
value, sending an attribute change event as usual. Note that you'll
have to use the LPS-generated HTML for this to work. Let me know how it
goes!
Regards,
Max Carlson
OpenLaszlo
Eduardo wrote:
Hello folks, I have implemented some javascript functions to access
OpenLaszlo methods, using the approach adopted in Flash. But, I don't
how to call Flash functions passing arguments. In the source code bellow
is shown how to call a function in Openlaszlo from Javascript without
passing arguments. Somebody know how to accomplish it?
Thanks,
Eduardo Lopes.
Source codes:
<html>
..........
*<script* type="text/javascript"*>*
* var* callFlashFunction = *function*(name) {
alert('callFlashFunction()');
*var* isIE = navigator.appName.indexOf ("Microsoft"
) != -1;
*if*(isIE)
*var* movieID = window["laszlo"];
*else*
*var* movieID = document["laszlo"];
movieID.SetVariable("_root.functionName", name);
movieID.SetVariable("_root.flag", *true*);
};
*</script>*
.......... in body section ...........
*<object* classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,79,0
<http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,79,0>"
data="laszlo.lzx?lzt=swf&debug=false
&lzr=swf8"
width="400"
height="300" id="laszlo"
*>*
*<param* name="movie" value=
"laszlo.lzx?lzt=swf&debug=false&
lzr=swf8"*/>*
*<param* name="quality" value=
"high"*/>*
*<param* name="scale" value=
"noscale"*/>*
*<param* name="salign" value=
"LT"*/>*
*<param* name="menu" value=
"false"*/>*
*<param* name="bgcolor" value=
"#ffffff"*/>*
*<param* name="swliveconnect" value=
"true" */>*
*<embed* src="laszlo.lzx?lzt=swf&
debug=false&lzr=swf8"
quality="high" scale="noscale"
salign="lt"
width="400"
height="300"
bgcolor="#ffffff"
type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer"
name="laszlo" swliveconnect="true"
*/>*
*</object>*
</html>
laszlo.lzx
*<canvas* width="400" height=
"300"*>*
*<font* name="vera" src="bitstream-vera-1.10
/vera.ttf"*/>*
*<script>*
_root.watch("flag", function(){
eval(this.functionName)();
});
_root.myFunction = function(){
texto.setText('teste teste');
}
*</script>*
* <text* id="texto" font=
"vera"*>* asdf asdf asdf *</text>*
***</canvas>*
------------------------------------------------------------------------
_______________________________________________
Laszlo-user mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-user
_______________________________________________
Laszlo-user mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-user