UIComponent in Swc
Posted
by mustISignUp
on Stack Overflow
See other posts from Stack Overflow
or by mustISignUp
Published on 2010-06-07T15:51:25Z
Indexed on
2010/06/08
17:32 UTC
Read the original article
Hit count: 157
flash
|actionscript-3
In Flash, if i create a custom Movieclip, and compile it to a SWC, i can use it in .fla files (by linking to the .swc)..
var mcInstance = new CustomMovieClip();
addChild(mcInstance);
All the arrangement of graphics on the custom movieClip's layers is preserved.
If i subclass UIComponent and compile to a swc, I can use the custom Class in my .fla file, but the new instance doesn't seem to construct the children arranged on the layers.
I know that the correct way to make a custom component is to have the two frames, first to specify bounding box, second frame for assets, and that the first graphic in frame 1 is removed at runtime. But i'm not really trying to make a reusable component - i just want to use the UIComponent class (It seems to have some nice extensions to Sprite).
As i really want some hand-positioned layers inside the component i figured i could have the bounding box as the first element on frame 1 (knowing that it would be removed), but any other items i put on frame 1 would be preserved - buttons, images, lines, etc.
Is this possible?
© Stack Overflow or respective owner