Hello there,

I got here a string comparing problem (or I think it is). I try to random generate a number and, say I will drag that number over some other instances, when that number match a instance's name, it will shows "correct"
Now, I got a object instance called a07.

on (release) {
display = substring((Math.random()), 1, 3);
}

Occasionally, display will equal 0.7
Now, with the following coding,

hello = "0." + substring(this._droptarget, 4,1);
// where this.droptarget is the instance a07
if (hello == display) {
_root.green_box.gotoAndStop(2); //Let's say it do stuff A
} else {
_root.green_box.gotoAndStop(3); //Let's sat it do stuff B
_root.a07.gotoAndStop(3);
}

hello should equal 0.7 as well. However, everytime I drag the number over a07, it will do the else part rather than the if part. I must have misunderstand something about the string class...


Could anyone help me here? Thank you very much.

Kelly