Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* I have a system where the application loads an external stylesheet and applies it to all display objects. One of the features of that stylesheet is a attribute comparison, eg [hover=true]. When a display object requests its stylesheet, it walks through all the defined styles, including those with an attribute comparison. I have to be able to check whether or not a (non-dynamic) object has a certain property and whether it matches the value defined in the style. This is where object.hasOwnProperty() comes in to play. AFAIK it's the only way of doing this without using a try/catch block. Code goes something like this: */
- for(var key:String in _equals) {
- if(!component.hasOwnProperty(key) || component[id] != _equals[id]) {
- return false;
- }
- }
- return true;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement