0

I have a Vgroup with some components aligned par with its layout properties(vertical). I need to add one more component at an absolute X,Y position, overriding the alignment. I tried includeinlayout=false, but the component turns invisible then. Is it possible in flex?

Saju
  • 402
  • 3
  • 11
  • 30

2 Answers2

0

No, this is not possible. A VGroup will ignore properties such as X, and Y. IF the component is visible, then includeInLayout is also ignored.

You'll have to layout your extra component outside of the VGroup, or switch to a Group and layout everything absolutely.

JeffryHouser
  • 39,401
  • 4
  • 38
  • 59
0

It is not possible! But you always can get global coordinates of the needed DisplayObject and show some PopUps or other components near to this target.

MXML:

<s:VGroup x="50" y="50">
    <s:Button width="250" height="250" id="b1"/>
    <s:Button width="250" height="250" id="b2"/>
</s:VGroup>

<s:Button id="addon"/>

AS:

var rect:Rectangle = b2.getBounds(this);        
addon.x = rect.x + rect.width - addon.width;
addon.y = rect.y;
JeffryHouser
  • 39,401
  • 4
  • 38
  • 59
Alex
  • 897
  • 10
  • 17