Jump to content
Search Community

tomato

Members
  • Posts

    10
  • Joined

  • Last visited

Everything posted by tomato

  1. Thanks. Trying that and still getting weirdness – things scaling when they shouldn't, rotation odd when using the NumStepper. Have roughed out a test case – it's a Flex project in Flash Builder – though the elements that TransformManager sees are all AS3. Appreciate any help or tips you can offer! TransformManagerIssue.fxp.zip
  2. Thanks for the reply. I've tried to work up a test file to show the problem/task but there are too many elements to do that easily. Let me distill my question: how can I set display properties programatically (x, y, width, height, rotation) on a Sprite object that is managed by the TransformManager? – only one Sprite object is selected at a time – all Sprite objects are registered with the TransformManager when they are created
  3. Driving myself crazy here trying to integrate the TransformManager into a legacy Flex project. I've finally resorted to eliminating the Flex part that TransformManager has to deal with (or so I think). So... What I need to do is 1. Save and restore transformation data NOT using the built in XML scheme 2. Enable user control through NumericSteppers in addition to direct interaction. I've try to go easy on the code below. The settings are stored in an Object. The "canvas" is a Flex SpriteVisualElement. It can change in size if the user opts for "full screen" mode – so property settings are stored as percentages and the current values are derived from the current size of the "canvas". The items being managed by the TransformManager are nested custom classes inherited from Sprite: And item is structured like this: CustomBaseClass – Sprite CustomSuperClass – Sprite BitmapClass – Sprite - loads & parents a Bitmap VectorClass – Sprite - loads & parents a SWF The results are erratic – things jump all over, the proportions get distorted. Is there an order of operations I should follow? Or a better ways of doing this? I guess I can cram all the code into one class if that would work. Am I doing this Wrong? var newX:Number = canvas.width * (_winEvent.percentRect.x/100); var newY:Number = canvas.height * (_winEvent.percentRect.y/100); var newWidth:Number = canvas.width * (_winEvent.percentRect.width/100); var newHeight:Number = canvas.height * (_winEvent.percentRect.height/100); var newRot:Number = _winEvent.rotation; _transformItem.x = newX; _transformItem.y = newY; _transformItem.width = newWidth; _transformItem.height = newHeight; // reset rotation _transformItem.rotation = 0; _transformItem.rotation = newRot; // have tried the 'rotate' function too //_transformItem.rotate(radians); // **have tried calling 'update' //_transformItem.update(); // ** have also tried // transformManager.updateSelection(true)
  4. Nevermind – I found it. It's a stupid Flex thing. Looks like I will have to hack the TransformManager code to "fix" it.
  5. I have a Flex4 project in which I am using TransformManager. Think of it as an "image collage" type app with a "canvas" area and tool and channel sidebars like in Photoshop. The TransformManager "autoDeselect" property is set to true and I have added both sidebars to thr TM's "ignore" list. It mostly works ok except there is a "dead" area on one section of my canvas (a Spark Group element). This means that clicks in those areas does not trigger an autoDeselect. However if I have a "collage" element in that area, I AM able to select it – so it's confusing. This is likely a "stupid Flex" problem than a TransformManager issue but I've been trying to debug this for hours and I haven't been able to identify what is eating the mouseClicks. Question: Can someone point me to the function in TransformManager which processes mouse click events. I looked a bit at the source code and put in some trace statements but didn't gat any output. I am thinking that maybe Flex has created some invisible crap skin thing in the "dead" area which is part of one of the ignored sidebars– but I have no idea how t get at it. Thanks!
  6. OK - was able to get a result using "toXMLString" – what I found off is that "exportFullXML" apparently returns a stringified version of the XML. var xml:XML = manager.exportItemXML(manager.targetObjects[1]); trace("xml??", xml.toXMLString());
  7. I am trying to use "exportItemXML" with TM VERSION: 1.9669 – it is not working. In a test project, I load in some movieClips and then call the trace statements below. The Console output is at bottom. - the movieClips exist and are managed by my TransformManager instance - the exportFullXML command works Am I using "exportItemXML" wrong? Or is this a bug? trace("objects", manager.targetObjects); trace("xml?", manager.exportItemXML(manager.targetObjects[1])); trace("single object", manager.targetObjects[1]); trace("all xml", manager.exportFullXML()); var xml:XML = manager.exportItemXML(manager.targetObjects[1]); trace("xml??", xml); Console output objects [object MovieClip],[object MovieClip],[object MovieClip] xml? single object [object MovieClip] all xml <transformManager> <settings allowDelete="0" allowMultiSelect="1" autoDeselect="1" constrainScale="1" lockScale="0" scaleFromCenter="0" lockRotation="0" lockPosition="0" arrowKeysMove="1" forceSelectionToFront="1" lineColor="3381759" handleColor="16777215" handleSize="8" paddingForRotation="12" hideCenterHandle="0" hasBounds="0"/> <items> <item name="red" level="0" a="1" b="0" c="0" d="1" tx="100" ty="100" xOffset="0" yOffset="0" rawWidth="100" rawHeight="100" scaleMode="scaleNormal" hasSelectableText="0" minScaleX="-Infinity" maxScaleX="Infinity" minScaleY="-Infinity" maxScaleY="Infinity"/> <item name="blue" level="1" a="1" b="0" c="0" d="1" tx="400" ty="100" xOffset="0" yOffset="0" rawWidth="100" rawHeight="100" scaleMode="scaleNormal" hasSelectableText="0" minScaleX="-Infinity" maxScaleX="Infinity" minScaleY="-Infinity" maxScaleY="Infinity"/> <item name="green" level="2" a="1" b="0" c="0" d="1" tx="700" ty="100" xOffset="0" yOffset="0" rawWidth="100" rawHeight="100" scaleMode="scaleNormal" hasSelectableText="0" minScaleX="-Infinity" maxScaleX="Infinity" minScaleY="-Infinity" maxScaleY="Infinity"/> </items> </transformManager> xml??
  8. This was my bug. I posted a solution over at StackOverflow
  9. This was my bug. I've posted the solution on StackOverflow
  10. I am using TM v: 1.9669 (purchased by a client last week) in a Flex 4.6/AS project and am seeing some odd behavior. I've spent the day trying to fix this but have had no success. The issue is that with an item selected, the TM "move" cursor appears outside the selection bounds, and it seems like there is a ghost shape or something the same size as the selection but offset from the center which is triggering it. That's clear, right? There's an image below to show what I mean. I added the red rectangle in Photoshop to indicate the ghost area which is triggering the TM move cursor. This area is active and the selection can be moved by clicking and dragging within the red rectangle. I've built a stripped down Flex project which shows this issue and attached the exported .fxp below (without the TransformManager lib, of course). I've tried every way from Tuesday to determine if this is my bug and am not seeing it. Is this a Flex bug, a TM bug? The selected item is a Flex Spark group which loads an swf. It is pretty bare bones, so I am baffled as to where this ghost shape is coming from. I've stripped out the loader AS code below <?xml version="1.0" encoding="utf-8"?> <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" width="5" height="5" resize="resizeHandler(event)"> <s:SWFLoader id="eventBtn" width="{this.width - 5}" height="{this.height - 5}" x="{regX}" y="{regY}" verticalAlign="middle" horizontalAlign="center" complete="btn_completeHandler(event)" /> <s:Rect id="bitmapBorder" x="{regX}" y="{regY}" width="100%" height="100%" visible="true"> <s:stroke> <s:SolidColorStroke color="#ffffff" weight="2" /> </s:stroke> </s:Rect> </s:Group> TransformManagerBug.fxp.zip
×
×
  • Create New...