1

I updated from air 3.1 to air 3.7 and seems like now a button that worked fine cannot be clicked.

The button is inside a spark VGroup.

<s:Group id="noConnection" visible="false" alpha="0.9">
    <s:Rect width="{Utils.application.width}" height="{Utils.application.height}">
        <s:fill><s:SolidColor color="0xFFFFFF" /></s:fill>
    </s:Rect>
    <s:VGroup id="vgroup" verticalAlign="middle" verticalCenter="0"
        horizontalAlign="center" horizontalCenter="0">
        <s:Button label="Try again" click="retry_clickHandler(event)" />
        <s:Label text="No connection"/>
    </s:VGroup>
</s:Group>

In the code above no MouseEvent or TouchEvent is triggered when i press the button. (it also doesn't animate).

However if a remove the verticalAlign" ,verticalCenterhorizontalAlignandhorizontalCenter` from VGroup attributes the button works fine again.

Like this:

<s:Group id="noConnection" visible="false" alpha="0.9">
    <s:Rect width="{Utils.application.width}" height="{Utils.application.height}">
        <s:fill><s:SolidColor color="0xFFFFFF" /></s:fill>
    </s:Rect>
    <s:VGroup id="vgroup">
        <s:Button label="Try again" click="retry_clickHandler(event)" />
        <s:Label text="There's no connection" />
    </s:VGroup>
</s:Group>

Any idea why this happens?

Thanks

zero323
  • 322,348
  • 103
  • 959
  • 935
Dan Dinu
  • 32,492
  • 24
  • 78
  • 114
  • 2
    Just a wild guess, but it smells like something else (transparent) is overlaying your Button; which would be why it works as expected when you move the Button to some other place by removing its positioning attributes. – RIAstar Jul 03 '13 at 21:57
  • @RIAstar could it be the Rect? there's nothing else in the view but this group. – Dan Dinu Jul 04 '13 at 21:05
  • 1
    @DanDinu the `VGroup` is on top of the `Rect`, so the `Rect` can't be interfering w/the mouse over the `VGroup`. In regards to nothing else in the view, what is the parent of this `Group`? How do you make it visible? What other things are on screen in your application? The answer might be in the code that makes all this happen, then again maybe not :) – Sunil D. Jul 04 '13 at 21:18
  • 1
    You could try using something [fxspy](http://code.google.com/p/fxspy/) to find out whether there really is something on top of the Button. – RIAstar Jul 04 '13 at 21:22

1 Answers1

0

things are running pretty well as I run the following codes . only I did not get why you made visibility of parent group to false. kindly check the following modified codes:

<s:Group id="noConnection" visible="true" alpha="0.9">
 <s:Rect width="400" height="400">
     <s:fill><s:SolidColor color="0xFFFFFF" /></s:fill>
 </s:Rect>
 <s:VGroup id="vgroup" verticalAlign="middle" verticalCenter="0"
                      horizontalAlign="center" horizontalCenter="0">
  <s:Button label="Try again" click="retry_clickHandler(event)" />
  <s:Label text="No connection"/>
  </s:VGroup>
 </s:Group>
Rajendra
  • 13
  • 3