简体   繁体   中英

How do I get the root display object of a MovieClip to be a MovieClip object with Flex?

I am trying to build an MXML application with Flash Builder 4.5, and I am integrating an API that requires the root of a display object to be a MovieClip. Personally I think this is bad design but I have to go with it. The root object always seems to end up as the stage, because of course I have to add the object to the stage for it to be added to the display list. Is there some way that I can either change the stage type in an MXML application to a MovieClip or is there some way to force a MovieClip wrapper to become the root of a display object?

Both mx Application and Spark Application inherit from Sprite, not MovieClip. Take a look at the inheritance chain at the top of

mx Application docs

Spark Application docs

The third-party API can't cast your Flex movie to MovieClip, because it's not one.

HTH;

aMY

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM