one simple option is to store and retrieve the value in a canvas attribute, e.g.
<canvas>
<attribute name="baseURL" type="string" value="" />
.....
.. and in the script use canvas.setAttribute and canvas.getAttribute to set/get the values.
HTH,
Mario.
On 3/22/06, Matt Hubbard <[EMAIL PROTECTED] > wrote:
Hello,
I am a total newbie with openlaszlo, so any help is very much
appreciated. I have a script that works with multiple datasets. It
extracts a url from the first dataset, tweaks it, and then I need to
pass that value to another method that works with a different dataset.
I am having problems passing the variable "baseURL" to a different
method. I confess that I do not understand how scoping is working in
lzx. Any direction would be most appreciated! Here are the two methods
I have so far.
<datapointer xpath="data:/resource" > <method name="processURL">
var c = this.xpathQuery('url/text()');
var urlArray = c.split("/");
var baseURL = '';
for(var i = 0; i < urlArray.length-1; i++){
var baseURL = baseURL +'/'+ urlArray[i];
}
return baseURL;
</method>
</datapointer>
<datapointer xpath="content:/resource" > <method name="processContent">
var f = this.xpathQuery('node/img/@src');
Debug.write(f);
var swfsrc = baseURL + f;
Debug.write(swfsrc);
swf.setSource(swfsrc);
</method>
</datapointer>
Thanks,
Matt Hubbard
_______________________________________________
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
