On Dec 14, 2007, at 10:58 AM, dopenhagen wrote:

Hello Jon,

Thanks for your reply.
I had also found the Alessandro posting and found it to be quite
valuable. However, despite his codesnippet, I am still having trouble
skinning the control-handles of the TransformTool-Control.


You have a few ways to do it. Either you embed the graphic asset into the control class itself (say, TransformToolScaleControl), or you set the skin at runtime. Check out the setSkin method of the TransformTool class:

                public function setSkin(controlName:String, 
skin:DisplayObject):void {
var control:TransformToolInternalControl = getControlByName (controlName);
                        if (control) {
                                control.skin = skin;
                        }
                }

The controls extend TransformToolInternalControl - that's another place you can look. TransformToolInternalControl has a public set skin property - pass it a display object.

For sake of argument....

[Embed(source="/assets/newScaleControlImage.png")]
public var img:Class;
public var scaleCtrl:BitmapAsset

scaleCtrl = BitmapAsset( new img() );

transformToolInstance.setSkin( "scaleTopLeftControl", scaleCtrl);
transformToolInstance.setSkin( "scaleTopControl", scaleCtrl);
transformToolInstance.setSkin( "scaleTopRightControl", scaleCtrl);
transformToolInstance.setSkin( "scaleRightControl", scaleCtrl);
transformToolInstance.setSkin( "scaleBottomRightControl", scaleCtrl);
transformToolInstance.setSkin( "scaleBottomControl", scaleCtrl);
transformToolInstance.setSkin( "scaleBottomLeftControl", scaleCtrl);
transformToolInstance.setSkin( "scaleLeftControl", scaleCtrl);

Now, no guarantees this code will function right. I just typed it up right here quickly without testing anything.

good luck.

- jon

Reply via email to