[Flashcoders] why the result is true

2006-10-13 Thread hbbalfred
hi everyone
i found the result is true when undefined = or = any value in
flash2004 and flash8.
that makes me wonder,the result was undefined in my sense as same as
undefined  or  any value.
i don't know flash player how get that,it really weird...orz
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] why the result is true

2006-10-13 Thread Zeh Fernando

hi everyone
i found the result is true when undefined = or = any value in
flash2004 and flash8.
that makes me wonder,the result was undefined in my sense as same as
undefined  or  any value.
i don't know flash player how get that,it really weird...orz


It's because instead of really comparing if the variable is higher than or 
equal to the number (for example), it checks if it's lower than the number 
(it's faster). Since it's not (because it's undefined), it seems to think 
it's is higher than or equal to the value, thus returning true.


If you're uncertain of whether a variable is undefined or not, you should 
use isNaN() first.



Zeh 


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com