PDA

View Full Version : not beeing able to access a global variable


coszmin
01-08-2005, 05:17 AM
Hi ,

In my code i have two methods in a "controller" object I have defined to keep al my presentation logic .

One creates a window , the other one , should make the window disapear .


<method name="enterWindow">
wind = new MyWindow(); // works
wind.setAttribute('closeable' , 'false'); //works

</method>

<method name="destroyWindow">
wind.destroy();
// at runtime it gives two errors , saying
// that wind does not exist and destroy
// mehod does not exist

</method>



This to me is contrary to the laszlo documentation paragraph wich states : "In JavaScript, all variables are global unless they are preceded by the keyword var. "


Anybody else has had this problem ?