Its very nice of many sites and ASDoc to give you examples of code with Sprite, too bad its not easy to use them in Flex... so what do we do ?
Use UIComponent as the bridge between Flash and Flex
Most of the ASDoc and online example how a Sprite being used for the sample app.
However if you try and add a Sprite or MovieClip to a Flex Display list you will get a runtime error.
So the key is to first add a UIComponent to the display list and then add the MovieClip or Sprite to it.
var ui:UIComponent = new UIComponent();
var sprite:Sprite = new Sprite();
var movieClip:MovieClip = new MovieClip();
ui.addChild(sprite);
ui.addChild(movieClip);
this.addChild(ui);
I wish someone would have documented this ...
Would of saved me some time.
Regards,
Sean - HeliHobby.com