Just 1 more thing...
It shouldn't matter if the class method is being called from within a
method within another class.
I have declared the class instances globally.
this is a simplified version of my class:
------
var imageSwapper = Class.create({
initialize: function()
{
this.currentItemCode = '';
},
switchTo: function(variant,toselect)
{
this.currentItemCode = '3SE0723W-25-30';
},
resetImage: function()
{
if(currentItemCode)
{
alert('image code set');
}
else
{
alert('no item code');
}
}
});
var image_swapper;
function initImageSwapper() { image_swapper = new imageSwapper(); }
Event.observe(window, 'load', initImageSwapper);
------
On Dec 27, 12:12 pm, Rob <[EMAIL PROTECTED]> wrote:
> Hi,
> I'm having an issue with class variables, after upgrading to 1.6
>
> in the initialize function i have
> this.currentItem = '';
>
> The class method switchTo is called by a mouseover event.
> this.currentItem is then changed to for example '3SE0723W-25-30'
>
> Then class method resetImage is called by a mouseout event.
> this.currentItem has not been touch during this time... yet in the
> resetImage method the value of this.currentItem is false... ?
>
> Thanks
> Rob
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---