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;
}
}
}