header
ask question
Click here to ask Question Now Its free No registration required. Flash, Flex, Flash Media Server, ActionScript,Adobe Air. Most questions receive a response in an hour.
amutha
Points:400
Posts:0

9/2/2010 5:23:44 AM

Title: link bar


how to highlight selected tab in link bar?



1
Howard
Points: 0
Posts:0
9/3/2010 4:51:12 AM



you can use this simple function to check the selected Item in Linkbar and highlight it. When dataprovider is array for Linkbar it does no show selected link. See this code example in actonscript 3 and flex to fix this .


<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
	<mx:Script>
		<![CDATA[
			import mx.events.ItemClickEvent;
			
			protected function linkBar_itemClick(event:ItemClickEvent):void
			{
				for(var i:int=0; i<event.target.numChildren; i++){ 
					var curItem = event.target.getChildAt(i);
					i==event.index ? curItem.setStyle("color", 0x2a80d5) : curItem.setStyle("color", 0x000000);     
				}
			}
			
		]]>
	</mx:Script>
	<mx:Array id="arr">
		<mx:Object label="One" data="1" custom="Apple" />
		<mx:Object label="Two" data="2" custom="Banana" />
		<mx:Object label="Three" data="3" custom="Orange" />
	</mx:Array>
	<mx:LinkBar id="linkBar" dataProvider="{arr}" itemClick="linkBar_itemClick(event);" />
</mx:Application>

2
vikas
Points: 0
Posts:0
6/21/2011 4:58:26 AM



Thank you

3
vikas
Points: 0
Posts:0
6/21/2011 5:58:27 AM



Can't we select the background color of selected tab of linkbar?

Thank you in Advance


Post your Reply
Name  

Email

Type your Reply or Answer

Are you human? What is 8+8 



Members Login

Email  
Password
Forgot Password





This website focus on: Flash | Flex | FMS | RED5 | WOWZA | Flash Media Server | Adobe AIR | ActionScript,Flash Solutions | Flash Question | Flash Answers | Flash Developers | Flash Problem, Flash Help, Flash bugs, Flash workaround | Flash Blog | Flex Question Answers | Flash Forum | Flex Development | Actionscript development | Flash development | Adobe AIR development
Copyright © 2008 AskMeFlash.com. All rights reserved. Privacy Policy | Terms & Conditions