Quantcast
Viewing all articles
Browse latest Browse all 5648

hasOwnProperty with namespace

Is there a way to check if an object instance has a non-public
property if you know its namespace?

If you say object.hasOwnProperty("name") it will only return true if
"name" is public. However, it returns false if "name" is, say,
mx_internal (or under another namespace): mx_internal var name:String;

I've tried:

object.hasOwnProperty("name"); //false
object.hasOwnProperty(new QName(mx_internal, "name")); //false
object.hasOwnProperty(new
QName("http://www.adobe.com/2006/flex/mx/internal", "name")); //false

Any ideas? This web post[1] seems to imply that at least at one point
it was possible to use QName in conjunction with non-XML objects'
hasOwnProperty() function. Has this changed, or am I doing something
wrong?

Thanks!

[1] http://www.leichtgewicht.at/718/mastering-as3-namespaces/#qname

Viewing all articles
Browse latest Browse all 5648

Trending Articles