Ran into a weird one in HTML5. Not sure if it is a bug or something I don't understand.
Apparently, if you set a variable to an array index it becomes strongly typed as a number? If you then try to set it to a string it results in NaN. But set it to another number and no problem.
But if you set the variable to a number it remains loosely typed and can then be set to a string no problem. Is this how it should work?
Code
set(test2, 'string');
copy(test1, scene[get(xml.scene)].title );
copy(test1, test2 );
trace('TEST : ',get(test1) ); // TEST : string
set(test1, 1 );
copy(test1, test2 );
trace('TEST : ',get(test1) ); // TEST : string
copy(test1, scene[get(xml.scene)].index );
copy(test1, test2 );
trace('TEST : ',get(test1) ); // TEST : NaN
set(test3, 3);
copy(test1, scene[get(xml.scene)].index );
copy(test1, test3 );
trace('TEST : ',get(test1) ); // TEST : 3
Display More
NOTE: This is not how it works in Flash. instead of NaN in the above example it traces to TEST : string.