The only child of a SkinnableComponent is supposed to be Skin and other children go in the skin. There is no interface for SkinnableComponent, so I guess you have to test for it and add to its skin?
On 2/10/13 9:03 PM, "grimmwerks" <[email protected]> wrote: > I'm trying to pop something above items that are calling for fullscreen like > the VideoPlayer; but in my case I've extended the VideoPlayer and created a > SkinnableComponent for it. > > I've got a little bit of code that I'm using ubiquitously by a few different > components and for some reason this video player is being seen as NOT an > IVisualElementContainer but of course the addElement has to work with it vs > addChild; so I'm unsure how I can or really SHOULD be checking for this? > Here's the code: > > debugger.trace(this,'test: ' + (note.getBody() is IVisualElementContainer)); > var ui:UIComponent = note.getBody() as UIComponent; > if(note.getBody() is IVisualElementContainer){ > var n:IVisualElementContainer = note.getBody() as > IVisualElementContainer; > n.addElement(view); > }else{ > ui.addChild(view); > } > > > That first line outputs as false -- and forgive the note.getBody() - -that's > the way PureMVC / Fabrication sends messaging around. So I'm basically > sending the view of the videoPlayerMediator out to be dealt with but for this > the code throws an error: > > Error: addChild() is not available in this class. Instead, use addElement() or > modify the skin, if you have one. > at > spark.components.supportClasses::SkinnableComponent/addChild()[E:\dev\4.y\fram > eworks\projects\spark\src\spark\components\supportClasses\SkinnableComponent.a > s:1123] > at > com.creativity.player.view::OverlayPanelMediator/respondToFullScreenDisplayVie > w()[/Users/Shared/__WORK/Adage Creativity Player > Redone/src/com/creativity/player/view/OverlayPanelMediator.as:178] > > > > > Garry Schafer > grimmwerks > [email protected] > portfolio: www.grimmwerks.com/ > > > > -- Alex Harui Flex SDK Team Adobe Systems, Inc. http://blogs.adobe.com/aharui
