flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jude <flexcapaci...@gmail.com>
Subject Is there a way to check if a style exists on an object
Date Tue, 13 Jan 2015 01:45:45 GMT
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

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) {



  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message