Thanks, Manish - that worked great.

- Tom

At 05:43 PM 6/2/2005, you wrote:
>On 6/3/05, Tom Fitzpatrick <[EMAIL PROTECTED]> wrote:
> > I'm trying to find a way to quickly select and deselect panels that are
> > children of an hbox container. When a panel is selected I'd like to
> > highlight it in a simple way, such as changing its background color. If
> > another panel is clicked on, the previously selected panel's background is
> > changed back to normal.
>
>Here's some pseudocode:
>
><HBox>
>    <Panel mouseDown="makeSelected(event.target)" />
>    <Panel mouseDown="makeSelected(event.target)" />
>    <Panel mouseDown="makeSelected(event.target)" />
>    <Panel mouseDown="makeSelected(event.target)" />
></HBox>
>
>   var lastSelected = undefined;
>
>   function makeSelected(panel)
>   {
>     if (lastSelected != undefined)
>       lastSelected.backgroundColor = normal;
>
>     panel.backgroundColor = "red";
>     lastSelected = panel;
>   }
>
>So you don't have to loop.  Just keep track of the currently selected
>one and unselect it when something else is selected.
>
>
>----------
>Yahoo! Groups Links
>    * To visit your group on the web, go to:
>    * 
> <http://groups.yahoo.com/group/flexcoders/>http://groups.yahoo.com/group/flexcoders/
>  
>
>    *
>    * To unsubscribe from this group, send an email to:
>    * 
> <mailto:[EMAIL PROTECTED]>[EMAIL PROTECTED] 
>
>    *
>    * Your use of Yahoo! Groups is subject to the 
> <http://docs.yahoo.com/info/terms/>Yahoo! Terms of Service.






 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to