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!

Reply via email to