Search the Community
Showing results for tags 'flexcrop'.
-
Hello, I'm currently trying to implement a crop tool to our Application. My problem is that I keep getting indexOutOfRange errors from TransformManager.bringToFront either when clicking on the image I want to crop or when clicking outside to unselect it. The same application also gives me from time to time an "wrong parent" error when trying to remove the dummyBox, event though the instance passes the "_selection.parent == _parent" test just before (TransformManager.updateSelection). Both Errors seem very very weird as the range error is thrown even thought range is correct and the parent is ok. Does anyone have any clue on what I'm doing wrong ? Here's a sample app and my basic instanciation code : protected function application_creationCompleteHandler(event:FlexEvent):void { transformManager=new TransformManager(); transformManager.bounds = new Rectangle(0,0,955,600); imageCompo.image.source = "image.jpg" ; imageCompo.image.addEventListener(Event.COMPLETE,image_readyHandler); } protected function image_readyHandler(event:Event):void { trace ("complete"); // for some reason flex never tells you when the image is actually ready setTimeout(wtf_flex_handler,1000); } private function wtf_flex_handler():void { trace ("timer complete"); var crop:FlexCrop=new FlexCrop(imageCompo.image, transformManager); } and the imageCompo code : public class ImageComponent extends SkinnableComponent { [SkinPart(required="true")] public var image : Image; //...some basic stuff } Thanks in advance for any input that could help me, I'll give out anything I find if I do find something. proto-crop-greensock.zip
-
Hi, I'm trying to change the source of a spark image in which has a flexcrop applied to it. Simply changing the content image source combusts the flexcrop applied. Here's my idea find flexcrop on page export transform xml for item destroy transform change image source update rawWidth and rawHeight in saved xml Apply transform and flexcrop to image using updated xml So i'm half way through coding this mammoth solution (I hope) and wondered if any one had any quicker ideas Thanks David
-
Hey everyone, I have a problem with de FlexCrop and the applyItemXML on the TransformManager. I hope you can help me out. On my TransformManager i have a image with a FlexCrop object. This works all fine. Next i save the image proporties and the FlexCrop object separately in the database along with the xml from the function exportItemXML(). Also this is done without any problems. If i want to put back the image and FlexCrop object in to a new TransformManager the FlexCrop object while not apply to the image object. I see that the FlexCrop object is set, the double click is there. And the FlexCrop object on the Transfrommanager has his saved properties applied because the width, height, scale and rotation are set. My question: What is the right way to reload a FlexCrop object and his target object? can someone give me a simple example of a working peace of code? The code i use now: First add the image object: var _newImage:Image = Image(); _newImage.addEventListener(FlexEvent.READY, readyFunction); _newImage.name = [unique name]; _newImage.source = [the image source]; myTransformManager.addElement(_newImage); Than add the FlexCrop object when the above READY event is triggered: private function readyFunction(evt:Event):void { var _imageCrop:FlexCrop = new FlexCrop(DisplayObject(evt.currentTarget), myTransferManager, true); _imageCrop.name = [unique name]; //_xml is a var outside this function and contains the //proporties recieved from the exportItemXML() myTransferManager.applyItemXML(_xml); _imageCrop.update(); } I am working with Flashbuilder 4.6 Thanks... Dennis van Rijswijk
- 11 replies
-
- FlexCrop
- applyItemXML
-
(and 1 more)
Tagged with: