Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

How to make the text of Menubar and menubar items glow on mouse hover in Adobe Flex

Posted on 2009-12-28
6
Medium Priority
?
969 Views
Last Modified: 2013-11-19
I would like to make the text of Menubar and each of the menubar items glow on mouse hover in Adobe Flex

Thank for your help
<mx:MenuBar width="125" id="mainMenu" labelField="@label" cornerRadius="5">
			<mx:XMLList>
				<menuitem label="Search">
					<menuitem label="Address"/>
					<menuitem label="Intersection"/>
				</menuitem>
			</mx:XMLList>
		</mx:MenuBar>

Open in new window

0
Comment
Question by:debugged
  • 2
4 Comments
 
LVL 11

Expert Comment

by:vindys80
ID: 26136288
Hi,

I don't see a direct meothod to add effect to menubaritem. So was using transform for glow effect.
Got idea from this blog
http://sherifabdou.com/2008/05/make-an-image-glow-when-there-is-a-roll-over-using-the-colortransform-class/

Thanks,
Vindys
<mx:Script>
		<![CDATA[
			import mx.events.MenuEvent;
			import mx.controls.menuClasses.MenuBarItem;
			/**
             * Create The Functions and the colortransform
             */
             private var myColorTransform:ColorTransform;
             
             /**
             * Create the mouseOut
             */
             private function MOut(event:MenuEvent):void
             {
                 //what we want to do is reset everything back and the
                 //easiest way to do that is just to create a blank
                 //colorTransform and set it to the image
                 myColorTransform = new ColorTransform();
                 //we leave the default values which should return
                 //the image back to the original
                 MenuBarItem(MenuBar(event.currentTarget).menuBarItems[event.index]).transform.colorTransform = myColorTransform;
             }
			private function mOver(event:MenuEvent):void{
				//on the mouseOver we want it to glow,
                 //you can play around with the offset and see which one you
                 //like the best
                 myColorTransform = new ColorTransform(1,1,1,1,54,54,54);
                 //now we set the colorTransform that we created to the 
                 //image

				MenuBarItem(MenuBar(event.currentTarget).menuBarItems[event.index]).transform.colorTransform = myColorTransform;
			}
		]]>
	</mx:Script>
    <mx:MenuBar id="myMenuBar" labelField="@label" itemRollOver="mOver(event)" itemRollOut="MOut(event)">

        <mx:XMLList>
            <menuitem label="MenuItem A">
                <menuitem label="SubMenuItem A-1" enabled="false"/>
                <menuitem label="SubMenuItem A-2"/>
            </menuitem>
            <menuitem label="MenuItem B"/>
            <menuitem label="MenuItem C"/>
            <menuitem label="MenuItem D">
                <menuitem label="SubMenuItem D-1" 
                    type="radio" groupName="one"/>
                <menuitem label="SubMenuItem D-2" 
                    type="radio" groupName="one"
                    selected="true"/>
                <menuitem label="SubMenuItem D-3" 
                    type="radio" groupName="one"/>
            </menuitem>
        </mx:XMLList>
    </mx:MenuBar>

Open in new window

0
 

Author Comment

by:debugged
ID: 26140342
Thanks for your reply. But your solution makes the menubar item glow. I am looking to make the text (label of the menuitem) glow. You are right that there are no direct methods.
I think one way would be to make an image with the text glowing and embed it in the application and make that appear on mouse rollover.
0
 
LVL 11

Expert Comment

by:vindys80
ID: 26144266
Hi,

I think you are right... No other workaround is coming to my mind.

Thanks,
Vindys
0
 
LVL 39

Accepted Solution

by:
blue-genie earned 400 total points
ID: 26321521
I don't know flex very well (or at all).
 here's a tutorial that does it with the creating a custom label component (from what I can make out)
you might know how to make it work for the menuBar. (if you get it working please share so we can all learn)

http://www.admin.adfg.state.ak.us/confluence/display/Flex/Flex+Extend+a+Component

0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
By following these Magento e-commerce development tips, you can increase your website's conversion and profitability. Read this post for more details.
The viewer will learn how to count occurrences of each item in an array.
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
Suggested Courses
Course of the Month15 days, 4 hours left to enroll

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question