I am having trouble getting lzSetCanvasAttribute to work.
Two files are given below: setAttrTest.lzx and setAttrTest.html
In lzx file, the attribute attr is defined in canvas. The method onattr
prints a message in a debug window when value of attr is changed. Test
this by clicking on text "test"
In html file, a button calls a java function func() which calls an
alert box and then calls lzSetCanvasAttribute which changes the value
of the attribute. I expected to see a debug message but nothing
happens.
What am I missing? Thanks for any help!
<!--setAttrTest.lzx-->
<canvas debug="true" height="200">
<debug width="200" height="100" x="200" y="50"/>
<attribute name="attr" type="string" value="initial" />
<method event="onattr" >
Debug.write("in onattr");
</method>
<text name="test"> test method
<method event="onclick">
canvas.setAttribute("attr", "new value");
</method>
</text>
</canvas>
<!-- setAttrTest.html --->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript">
function func()
{
alert("calling lzSetCanvasAttribute");
lzSetCanvasAttribute('attr', 'newer value');
}
</script>
<link rel="SHORTCUT ICON"
href="http://www.laszlosystems.com/favicon.ico">
<link rel="stylesheet" href="/lps-3.1.1/lps/includes/console.css"
type="text/css">
<title>Laszlo Application</title><style type="text/css">
img {border: 0}
</style><script language="JavaScript1.1" src="/lps-
3.1.1/lps/includes/vbembed.js" type="text/javascript"></script><script
src="/lps-3.1.1/lps/includes/embed.js"
type="text/javascript"></script></head>
<body style="margin: 0">
<div style="background-color: #ffffff"><script type="text/javascript">
lzLPSRoot = '/lps-3.1.1';
lzCanvasRuntimeVersion = 7 * 1;
if (lzCanvasRuntimeVersion == 6) {
lzCanvasRuntimeVersion = 6.65;
}
if (isIE && isWin || detectFlash() >= lzCanvasRuntimeVersion) {
lzEmbed({url: 'setAttrTest.lzx?lzt=swf&?
lzt=history&__lzhistconn='+top.connuid+'&__lzhisturl=' + escape('/lps-
3.1.1/lps/includes/h.html?h='), bgcolor: '#ffffff', width: '100%',
height: '200', id: 'lzapp'}, lzCanvasRuntimeVersion);
lzHistEmbed(lzLPSRoot);
} else {
document.write('This application requires Flash player ' +
lzCanvasRuntimeVersion + '. <a
href="http://www.macromedia.com/go/getflashplayer"
target="fpupgrade">Click here</a> to upgrade.');
}
</script><noscript>
Please enable JavaScript in order to use this application.
</noscript>
</div>
<div>
<form>
<input type="button" value="test lzSetCanvasAttribute"
onclick="javascript:func()" />
</form>
</div>
</body>
</html>
_______________________________________________
Laszlo-user mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-user