Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...

wsvdmeer

Members
  • Posts

    8
  • Joined

  • Last visited

wsvdmeer's Achievements

0

Reputation

  1. Hey Jack, That's exactly what i was searching for! Thanks!
  2. Hey Jack sorry for my confusing explenation, I have a transformItem on the stage and 2 buttons one for rotating the object left( - ) and one for rotating the object right( + ). When i push one of the buttons the function rotateSelected is fired and i get a variable called "value" Button "Left" gives a value of -1 wich indicates that the transformItem has to rotate counter clockwise. Button "Right" gives a value of 1 wich indicates that the transformItem has to rotate clockwise. In short i want the user to rotate the object with the buttons. I know this is possible by calling TransformManager.rotateSelected("angle") But i have no idea on how to get the right value for the angle.
  3. Hi Jack, I'm having a problem rotating a selected item when i use the following code. How can i get the rotation right? ( is suck at math ). private function rotateSelected(value:Number) { //value = -1 or 1 var angle:Number = Math.atan2(currentTarget.x,currentTarget.y) manager.rotateSelection(angle+value) }
  4. Hey Greensock that helped a lot! i removed autoSize and it works perfect. Thank you! PROBLEM SOLVED
  5. Hey Greensock, I added the test fla with the stripped code and removed the transformation classes from the gs folder. I hope you can solve my problem . [attachment=0]Test.rar[/attachment]
  6. Hey GreenSock, I Chose not to reparent because i thought i could fix the problem by putting the TransformManager and the text/image objects in one Class(ObjectHolder). This way they all share the same parent (ObjectHolder). I'm not using flex for my application Canvas is just the name of the users designspace where they can add images and text objects and transform them.
  7. Hey Greensock, Thanks for the quick response! Here's the code im using to add DisplayObjects to my Canvas I made a class named ObjectHolder where i want to place my inputfields and images. Images transform perfect(1) the only problem i get is when i want to transform a textfield(2) I can rotate the textfield but when i want to scale the textfield and automaticly update the text (like your demo)it resets to its orginal box(3). Am i doing something wrong? (1) (2) (3) Canvas Class: public function addText(str:String = "Typ hier je tekst") { var txt:TextField = new TextField(); txt.defaultTextFormat = defaultFormat; txt.embedFonts = true; txt.autoSize = TextFieldAutoSize.LEFT; txt.type = TextFieldType.INPUT; txt.multiline = true; txt.text = str; txt.mouseEnabled = true; txt.selectable = true; stage.focus = txt; txt.addEventListener(MouseEvent.CLICK,selectObject) txt.setSelection(0, txt.text.length); } ObjectHolder Class: package com.wsvdmeer.ui{ import flash.display.Sprite; import com.gs.transform.*; import com.gs.events.TransformEvent; import flash.display.DisplayObject; import flash.display.Sprite; public class ObjectHolder extends Sprite { private var manager:TransformManager; public function ObjectHolder() { manager = new TransformManager({ arrowKeysMove:true, forceSelectionToFront:false, allowMultiSelect:true, allowDelete:true, handleSize:8 }); } public function add(obj:DisplayObject) { addChild(obj); trace(obj)//traces [object TextField] manager.addItem(obj); } public function scale(scale:Number) { manager.handleSize = 8/scale; } } }
  8. Hi There, The company where i work just bought the TransformManager (as3) and i have a question about transforming inputfields. I add a inputfield with the following function: //-PUBLIC & INTERNAL METHODS ------------------------------------------------------------------- public function addText(str:String = "Typ hier je tekst") { var txt:TextField = new TextField(); txt.defaultTextFormat = defaultFormat; txt.embedFonts = true; txt.autoSize = TextFieldAutoSize.LEFT; txt.type = TextFieldType.INPUT; txt.multiline = true; txt.text = str; txt.mouseEnabled = true; txt.selectable = true; stage.focus = txt; txt.addEventListener(MouseEvent.CLICK,selectObject) txt.setSelection(0, txt.text.length); objectHolder.addChild(txt) manager.addItem(txt) } But when i want to scale the TextField i get the following result: As you can see the textField wont scale/update the text. Does anyone have a solution? Edit: I found out the problem has to do with the display list stated in this topic : http://forums.greensock.com/viewtopic.php?f=3&t=175 How can i reparent my TransformManager? Greetz WS
×