Share Posted August 5, 2011 Hi, I was having a little trouble when adding an image to the crop where it disapeared. ------------------------------------------------------- var image1:Image = new Image; image1.source="1.jpg"; myTransManager.addChild(image1); var mc1Crop:FlexCrop = new FlexCrop(videoStageObject, myTransManager.manager); ------------------------------------------------------- I had an idea that it's a usual flex issue where the image Display object isn't ready yet. solved by.... ------------------------------------------------------- var image1:Image = new Image; image1.source="1.jpg"; myTransManager.addChild(image1); TweenLite.delayedCall(1, addCrop, [image1]); private function addCrop(imageDO:DisplayObject):void{ var mc2Crop:FlexCrop = new FlexCrop(imageDO, myManager.manager); } ------------------------------------------------------- It works, but is there a neater way? Hope this helps someone Link to comment Share on other sites More sharing options...
Share Posted August 5, 2011 Yeah, Flex can be super annoying with little quirks like that. I'm not very familiar with the intricacies of the Flex framework, but I suspect that there's an event that gets fired by the Image when it is "officially" ready (maybe "creationComplete"?) Or you could use a delayedCall to call the update() methods of the associated TransformItem and FlexCrop. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now