Hi all!
I ran into a weird behaviour with the set() method.
I'm making a pano where I search for a hotspot, and I store the found hotspot into a variable with set() for later use.
Because I want a clear algorithm, I initialize the variables I make use of using
then later in the code, if I found the hotspot I'm looking for, I store it with
I'm expecting to be able to access the hotspot attributes with
but I only can trace "storageVar.name" or "null" if Im ake use of get().
This
is, in my opinion, very strange. And more over, I noticed that, if I DO
NOT initialize my variable with null, the code works as expected, I
trace the actual name of the hotspot!
Example:
set( secondStore, NULL );
for(set(i,0), i LT 1, inc(i),
set( storageHS, get(hotspot[%i]) );
trace('We copied original "', hotspot[%i].name , '" object as: ',
hotspot[%i], ' into ', storageHS, ' named "', storageHS.name, '"');
set( secondStore, get(storageHS) );
trace('We then copied "', storageHS.name , '" object as: ',
storageHS, ' into NULL initialized ', secondStore, ' named "',
secondStore.name, '"');
set( thirdStore, get(storageHS) );
trace('We last copied "', storageHS.name , '" object as: ',
storageHS, ' into non declared ', thirdStore, ' named "',
thirdStore.name, '"');
);
Display More
Result displayed:
INFO: We copied original "hs1" object as: [object Object] into [object Object] named "hs1"
INFO: We then copied "hs1" object as: [object Object] into NULL initialized [object Object] named "secondStore.name"
INFO: We last copied "hs1" object as: [object Object] into non declared [object Object] named "hs1"
Note on line 2 that: my storageHS is an Object (expected) but its name attribute can't be find while
on line 3, we can get the object and its attribute...
Does anyone can explain me what I'm missing?
You can have a live demo here:
http://anoril.no-ip.com/jsiTest/test.html ( xml is there: http://anoril.no-ip.com/jsiTest/test.xml )
To observe the issue, just move the view arround and click the interogation mark. :)
Regards,