I tried that in the creationComplete function and the show function. Neither hid the tab/button
On Fri, Mar 6, 2009 at 9:16 AM, Adrian Williams <[email protected]> wrote: > Hi Greg, > > does this not work for you? > > if (MyModel.getInstance().currentUser.useraccess == "99") > { > aHeadlines.visible = true; > } > else > { > aHeadlines.visible = false; > } > > > > Greg Morphis wrote: > > I'm trying to hide or destroy a button that's showing in an > ApplicationControlBar. > Basically when the user logs into the tool their information is > checked and one button or another will show. > > The code currently looks like > > <mx:VBox... > > <mx:ApplicationControlBar ... > > <mx:ToggleButtonBar id="adminMenu" .... dataProvider="{adminVS}"> > </mx:ApplicationControlBar> > > <mx:ViewStack ... id="adminVS" ... > > <AdminVW:AdminUser id="aUser" ... /> > <AdminVW:AdminSecurity id="securityBox" ... /> > <AdminVW:AdminMenu id="aMenu" ... /> > <AdminVW:AdminNews id="aNews" ... /> > <AdminVW:AdminTopAgentsid="aUser" ... /> > <AdminVW:AdminHeadlines id="aHeadlines" ... /> > ... > > What if I only wanted to show the AdminHeadlines button if when they > log in thier access is "99". > The access is stored in MyModel.getInstance().currentUser.useraccess > > I've tried using a function and setting the visiable and > includeInLayout to the return value, I.E.: > private function showHeadlines ():Boolean { > return (MyModel.getInstance().currentUser.useraccess == "99") > } > > But that's not working.. Ideas? > > Thanks! > > >

