You jump around a bit, so I think you're confused.
SWCs are just collections of classes. You wouldn't want to add a SWC to the stage, you'd want to add components in the SWC onto the stage. And techincally, in Flex, you rarely reference the stage directly. You just add children to their parent.
To answer your specific question, with Flex 4 components, such as group, you should use the addElement method instead of the addChild method. Just like your compiler warning says.
I'm a bit confused why you say that "addElement will work fine if used in a SWC File." That is not true. You might want to startsharing some code and tell us what component you're trying to add to what parent.
Hi, thanks for the fast answer.
I have build an programm where i can cut images : http://www.beeres.org/PictureCutting/
And i wanted to add an animation instead of some Numbers when the user uploads his Picture.
I have build an movieclip in which is animation that is 100 frames long.
Then i wanted to add to the upload-progress function this : uploadAnimation.gotoAndStop(Math.ceil(event.bytesLoaded/event.bytesTotal*100));
and thats it..
But i could not use a swc and when i want to add an swc file with addElement() it says the transformation into a not related type is not possible.
ps.I hope it is not too difficult to read.
You created the movieclip animation in Flex or in Flash?
If in Flash Pro, you'll have to "prep" the SWC for use in Flex. Use the Flash Component Kit for Flex ( http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&loc=en_us&extid=1273 018 / http://adobedev.adobe.acrobat.com/p75214263/ ).
To use spark groups and addElement, I think your class will have to implement IVisualElement , though.
I have build it in Flash Pro cs5 (i have a test version) and i exported it with some "preps".
I have done that the same way like this : http://www.gotoandlearn.com/play.php?id=108
I have ckecked it for "export for actionscript".
Then i named it uploadLoop.
After that i exported it as an SWC file.
And the swc file i added to my flex project and which I then wanted to work with.
Thank you again.