Copy link to clipboard
Copied
I would like to use Animate CC and UIComponents as UI editor. My problem is that some of properties are dependent on each other. When I change one of them then I would like to see live update of the second property in property inspector. Sample code:
public class Component extends UIComponent {
protected var _componentScaleX:Number;
protected var _componentWidth:Number;
public function Component() {
_componentScaleX = 1;
_componentWidth = 100;
}
[Inspectable(defaultValue="1")]
override public function get scaleX():Number {
return _componentScaleX;
}
override public function set scaleX(value:Number):void {
_componentScaleX = value;
}
[Inspectable(defaultValue="100")]
override public function get width():Number {
return _componentWidth * scaleX;
}
override public function set width(value:Number):void {
scaleX = value / _componentWidth;
}
}
Have something to add?
Find more inspiration, events, and resources on the new Adobe Community
Explore Now