I would like to know the official way too. FYI The Application is a special case. It is typed object so developers can add their own properties and methods to it without the compiler complaining. It should probably be treated as a special case.
In Flex 4 I've used IVisualElementContainer. For Flex 3 I think it's IContainer but from Flex 4 on I think IVisualElementContainer should also work. I don't know about FlexJS. One case based purely on the Flash display list (not Flex) is to check if the class is a subclass of DisplayObjectContainer? BTW You may also need to check for IGraphicElementContainer. In what cases did your check fail? FYI There may not be an official way yet. In which case this would be a good discussion point. For example, there is not an official way to know if a class is a skin class. This needs to be figured out at some point as well. On Tue, Oct 14, 2014 at 2:34 PM, Neverbirth <neverbi...@gmail.com> wrote: > Hello everyone, > > Tried to contact Alex with no luck, so will try posting here. As you may > know I'm working on bringing first class Flex support in FlashDevelop, and > I've recently found a case where I'm a bit puzzled on how it should be > properly implemented. > > In particular, I want to know when a class can have another class as a > children. For example <s:Application> may have a <s:Button> as a child. > > Right now this check is made: > > (tmpClass.Implements.Contains("IContainer") // > Flex > || > tmpClass.Implements.Contains("IVisualElementContainer") > || > tmpClass.Implements.Contains("IFocusManagerContainer") > || tmpClass.Implements.Contains("IPopUpHost") // > FlexJS > || tmpClass.Implements.Contains("IParent")) > > But I find it a bit hacky, and I already found a case where it's > failing. > I've thought of adding a check for [DefaultProperty], which will also > improve which classes are shown, but unless I have missed something it > seems > not all container classes have a default property defined. > > Do you happen to know which is the proper way of doing this? I'd like to > have proper support for Flex 4, FlexJS and Flex 3. I was thinking that > maybe > it should check for both all those interfaces and a DefaultProperty > implementation, but I'm not too fond of that solution (unless there is no > other way, of course). > > Thanks for your help. > > > > -- > View this message in context: > http://apache-flex-development.2333347.n4.nabble.com/Determining-which-MXML-elements-are-containers-tp41370.html > Sent from the Apache Flex Development mailing list archive at Nabble.com. >