Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

live update of UIComponent properties in inspector

New Here ,
Aug 24, 2016 Aug 24, 2016

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;

  }

}

TOPICS
ActionScript
131
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation