You can addEventListener for resize and added/removed events in capture
phase on canvas and check each event.target to see if it is child1 or a
parent of child1.

On 7/10/13 6:21 AM, "Cristina Constantinescu"
<[email protected]> wrote:

>Example:
><s:Group id="canvas" width="100" height="100">
>         <s:layout>
>             <s:BasicLayout />
>         </s:layout>
>
>         <s:Group id="component" x="10" y="10" width="20" height="20">
>             <s:layout>
>                 <s:BasicLayout />
>             </s:layout>
>             <s:VGroup id="child1" x="0" y="0" width="10" height="10"/>
>             <s:VGroup id="child2" x="10" y="5" width="10" height="10"/>
>         </s:Group>
>
>         <s:Image id="image" />
>         ...
>  </s:Group>
>
>What I need: when "child1" changes its coordinates (relative to
>"canvas"), the "image"coordinates  are modified in some way.
>So, this happens when:
>1. "component" changes dimensions/coordinates
>2. children changes their order in parent (e.g. "child2" becomes first
>element)
>
>Can "child1" be notified about these type of changes?
>
>Regards,
>Cristina
>
>On 10.07.2013 15:10, Cristina Constantinescu wrote:
>> Hello,
>>
>> Is there a way to notify children when parent changes its
>> dimensions/coordinates?
>>
>> For the moment, my solution is to add a resize event listener on parent.
>> When the event is dispatched, the child gets its global coordinates
>> and uses them to position some additional components.
>>
>> Is there another approach for this?  (like each child to be notified
>> somehow when their global coordinates are changing)
>>
>> Thanks,
>> Cristina
>

Reply via email to