3 Replies Latest reply on Aug 25, 2009 9:29 PM by Abbas AB

    hover on label

    Abbas AB

      Hi, I want the hover effect on the label but i dont know how to get it please tell me how i can achive it.

        • 1. Re: hover on label
          Gregory Lafrance Level 6

          I don't know if you mean a rollover/rollout effect or a tooltip, so this code shows both.

           

          If this post answers your question or helps, please mark it as such.

           

          <?xml version="1.0" encoding="utf-8"?>
          <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
            <mx:AnimateProperty id="grow" target="{myLabel}" property="fontSize"
              fromValue="12" toValue="50" duration="100" isStyle="true"/>
            <mx:AnimateProperty id="shrink" target="{myLabel}" property="fontSize"
              fromValue="50" toValue="12" duration="100" isStyle="true"/>
            <mx:Label id="myLabel" text="Hover Over Me"  rollOverEffect="grow"
              rollOutEffect="shrink" toolTip="You are now hovering over me!!!"/>
          </mx:Application>

          • 2. Re: hover on label
            Abbas AB Level 1

            Thanx, i want to change the color of the text in the label.

            • 3. Re: hover on label
              Gregory Lafrance Level 6

              If this post answers your question or helps, please mark it as such.

               

              <?xml version="1.0" encoding="utf-8"?>
              <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
                <mx:AnimateProperty id="red" target="{myLabel}" property="color"
                  fromValue="0x0000FF" toValue="0xFF0000" duration="600" isStyle="true"/>
                <mx:AnimateProperty id="blue" target="{myLabel}" property="color"
                  fromValue="0xFF0000" toValue="0x0000FF" duration="600" isStyle="true"/>
                <mx:Label id="myLabel" text="Animated Effect"  rollOverEffect="red"
                  rollOutEffect="blue" fontSize="50" color="0x0000FF"/>
                <mx:Label id="myLabel2" text="Simple RollOver"
                  rollOver="myLabel2.setStyle('color', 0xFF0000)"
                  rollOut="myLabel2.setStyle('color', 0x0000FF)"
                  color="0x0000FF" fontSize="50"/>
              </mx:Application>