tags:

views:

23

answers:

1

Hello people,

The problem is when background of top or below label is changed, the top or below button is erased.

<mx:Canvas width="100%" height="100%">
        <mx:LinkButton icon="{icon1}" width="25" x="10" y="10"/>
        <mx:LinkButton icon="{icon2}" width="25" x="10" y="100" />
    <s:VGroup width="100%" height="100%" id="lst" click="highlight(event.target as Label)" gap="0">
        <s:Label />
        <s:Label />
        <s:Label selected="true" />
        <s:Label />
        <s:Label creationComplete="fillList()"/>
    </s:VGroup>
</mx:Canvas>

    private function highlight(label:Label):void {
        setStyle("backgroundColor", "#DDDDDD");
    }

So do anyone know the possible solution for this problem?

A: 

You are sitting the VGroup on top of the buttons, so when you fill the background of a label, its obscuring the button.

If you reorder the components so that the buttons are sitting on top of the VGroup, this won't happen.

Literally put the VGroup before the buttons in the list of children in the Canvas.

Gregor Kiddie
Thanks a lot! Now I have another issue. I am trying to catch event on the Button when user down the button and hold the left mouse button. The problem is I want to catch it endlessly until user up the mouse. I tried buttonDown - it works as I want only when I hit spacebar. mouseDown handler catches only one time, so it works as a simple click. Any help will be appreciated
igu
I found it out. We should use autoRepeat="true" for button.
igu