Some question of object property name in Actionscript3.
Posted
by unsouled
on Stack Overflow
See other posts from Stack Overflow
or by unsouled
Published on 2010-04-12T05:54:13Z
Indexed on
2010/04/12
7:23 UTC
Read the original article
Hit count: 419
actionscript-3
|as3
A.as
package
{
public class A
{
public static var someObject:Object = {
(B.SOME_CONST): { value: 10 }
};
}
}
B.as
package
{
public class B
{
public static const SOME_CONST:String = "someStringConst";
}
}
And this is test code.
var obj:Object = A.someObject;
trace(obj.hasOwnProperty(B.SOME_CONST));
trace(obj.hasOwnProperty("someStringConst"));
trace(obj.hasOwnProperty("SOME_CONST"));
I expected that result will be true, true, false but real result is false, false, true. Why?
© Stack Overflow or respective owner