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.
nannu
Points:0
Posts:0
Answered

7/16/2010 4:50:59 AM

Title: disable a specific tab in togglebuttonbar


hi all,

i want to disable 2nd button ,plz guide

thanks


public class IconToggleButtonBar extends ToggleButtonBar
	{
		[Inspectable (enumeration='left,right,top,bottom', defaultValue='left')]
		public var labelPlacement:String = 'left';
		
		public function IconToggleButtonBar()
		{
			super();
		}
		
		override protected function createNavItem(label:String, icon:Class=null):IFlexDisplayObject{
			var b:Button = Button(super.createNavItem(label,icon));
			b.labelPlacement = labelPlacement;
			//Button(b.getChildIndex(1)).enabled = false;
			return b;
		}
		
		override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
			super.updateDisplayList(unscaledWidth, unscaledHeight);
			
		}
	}
}




1
Veer
Points: 480
Posts:0
Accepted Answer
7/16/2010 5:14:21 AM



Hi..

//////////// MXML ////////////////////////////

<mx:ToggleButtonBar id="toggleButtonBar" creationComplete="onCreationComplete(event)" itemClick="clickHandler(event);">
<mx:dataProvider>
<mx:Array>
<mx:String>Flash</mx:String>
<mx:String>Director</mx:String>
<mx:String>Dreamweaver</mx:String>
<mx:String>ColdFusion</mx:String>
</mx:Array>
</mx:dataProvider>
</mx:ToggleButtonBar>

/////////////// Script /////////////////////

private function onCreationComplete(event:FlexEvent):void
{
var arrChild : Array = toggleButtonBar.getChildren();
var childIndex : int = 2; // set index which you want to disable
arrChild[childIndex].enabled = false;
}

may help you..

Regards,
Virat Patel

2
nannu
Points: 0
Posts:0
7/16/2010 5:25:50 AM



hey buddy bingo ,it is working.

thanks a lot patel...


Post your Reply
Name  

Email

Type your Reply or Answer

Are you human? What is 0+0 



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