What about object.getStyle("style") === undefined? I don't think any styles are 
ever deliberately set to undefined.
 
- Gordon
 
> From: [email protected]
> Date: Mon, 12 Jan 2015 17:45:45 -0800
> Subject: Is there a way to check if a style exists on an object
> To: [email protected]
> 
> Is there a way to check if there is a style on an object?
> 
> We can use the following for properties:
> 
>  ("property" in object || object.hasOwnProperty("property"))
> 
> I'm looking for something like this:
> 
> ("style" in object || object.hasOwnStyle("style"))
> 
> If not does anyone want to write it or recommend a way or API for it to be
> written?
> 
> Just this second I thought of this:
> 
> ("style" in object.inheritedStyles || "style" in object.nonInheritedStyles)
> 
> If that works maybe we can add it:
> 
> // check if style exists
> public function hasStyle(styleName:String, inherited:Boolean = false) {
> 
> }
> 
> Jude
                                          

Reply via email to