3 Replies Latest reply on Sep 8, 2008 9:52 AM by Newsgroup_User

    highlight selected panel

    kilyas2007
      I have implemented an onclick method and added it to an eventlistener for a Panel in case of a mouseclick. So whenever the panel is clicked this method is going to be called. Now the question is that I want to highlight the panel selected, the simple default way where the selection clicked gets to have blue border line. Just as if you click a textbox it gets ti have a blue border. I want to do something similar for a panel.


      How could I do something like this for a panel.
        • 1. Re: highlight selected panel
          EvolvedDSM Level 2
          I wasn't aware that a panel had highlight properties and I've worked with panels in all my apps. A panel is just a container. You may be able to change the color of a panel if an input field within it gains focus, but I'm not sure how to implement the blue-border that an input box has. I will look briefly today to see if it's possible.
          • 2. Re: highlight selected panel
            Gregory Lafrance Level 6
            You could change the borderColor if the Panel or any of its children are clicked, but not sure how to change it back if the Panel or any of its children lose focus, as the Panel does not support a focusOut event.
            • 3. Re: highlight selected panel
              Level 7

              "Greg Lafrance" <glafrance@chikaradev.com> wrote in message
              news:ga3kio$84h$1@forums.macromedia.com...
              > You could change the borderColor if the Panel or any of its children are
              > clicked, but not sure how to change it back if the Panel or any of its
              > children
              > lose focus, as the Panel does not support a focusOut event.
              >
              > <?xml version="1.0" encoding="utf-8"?>
              > <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml">
              > <mx:Script>
              > <![CDATA[
              > private function onClick():void{
              > pnl.setStyle("borderColor", "0x0000FF");
              > }
              >
              > private function mouseOut():void{
              > pnl.setStyle("borderColor", "0x000000");
              > }
              > ]]>
              > </mx:Script>
              > <mx:Panel id="pnl" width="200" height="200" borderColor="black"
              > click="onClick()" mouseOut="mouseOut()"/>
              > </mx:Application>

              You could store the panel ID's in an array and set the ones that are not the
              event.currentTarget back to the default.