Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I recommend you to solve the problem on a ExpandCollapseMenu container level. When ExpandCollapseMenu's state is changed you should iterate over children and set some flag for each of them.</p> <p>So I suggest to introduce expanded:Boolean flag for ExpandCollapseMenuButton.</p> <p>The problem occurs if ExpandCollapseMenu can contain other instance's types. In this case we can solve it using the following two ways:</p> <ol> <li>Check components in process of iterating if they are ExpandCollapseMenuButton instances (using is operator).</li> <li><p>Introduce simple Expandable interface like the following:</p> <pre><code>public interface Expandable { function set expanded(value:Boolean); } </code></pre></li> </ol> <p>and implement this interface by ExpandCollapseMenuButton. So you can use is operator in iterator body more flexible way without ExpandCollapseMenuButton dependency.</p> <p>So the last part of puzzle is to implement setter in ExpandCollapseMenuButton class and switch skin:</p> <pre><code>private var expandedDirty:Boolean; private var _expanded:Boolean; public function set expanded(value:Boolean) { if (value == _expanded) return; _expanded = value; expandedDirty = true; invalidateProperties(); } override protected function commitProperties():void { super.commitProperties(); if (expandedDirty) { if (_expanded) setStyle("skinClass", ExpandCollapseMenuButtonExpandedSkin); else setStyle("skinClass", ExpandCollapseMenuButtonSkin); expandedDirty = false; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload