i finally figured it out i put the buttons in a hbox and used the
hbox.xhilddescriptors array with a loop. once the visibility is set
it moves them into another hbox to keep the buttons side by side. i
am not sure how to paste the code in here where it is still aligned,
sorrry.
public function Loop():void{
var ArCtr:int
var ArMax:int =
Holding.childDescriptors.length
do{
callCF
(499,'toolbar',Holding.childDescriptors[ArCtr].id)
ArCtr++
//Alert.show(cmdID)
}while (ArCtr<ArMax);
this.mainbar.visible=true
//Stepper=Stepper+1
}
public function callCF
(UserFLID:int,ObjectType:String,ObjectName:String):void{
this.dataManager.UserRights
(UserFLID,ObjectType,ObjectName)
}
public function update_result
(event:ResultEvent):void{
var ObjName:String = StringUtil.trim
(event.result.list.source[0].ObjectName)
var ObjValue:String = StringUtil.trim
(event.result.list.source[0].objvalue)
if (ObjValue=="D"){
this[ObjName].visible= false;
}else{
this[ObjName].visible= true;
//move to main mainbar from
holding
this.mainbar.addChild(this
[ObjName])
}
}
--- In [email protected], "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> ButtonBar, if you used it, has a dataProvider that represents each
> button in the bar. Show us some sample code so we can see what
> direction you're going in
>
>
>
> ________________________________
>
> From: [email protected]
[mailto:[EMAIL PROTECTED] On
> Behalf Of mazarflex
> Sent: Thursday, May 31, 2007 12:03 PM
> To: [email protected]
> Subject: [flexcoders] Re: create new button with an icon
>
>
>
> so i am making a toolbar each button has a specific name
> (ex."CmdInfo"). in sql i have a procedure. if you pass it "CmdInfo"
> is returns "F" meaning visibility=false. i need to loop through all
> of the buttons on my form and pass their names to SQL. i dont know
> where to start i thought i had it with an array but i could not do
> the icon or the click. ugh!!! help me please thank you
>
> --- In [email protected] <mailto:flexcoders%
40yahoogroups.com>
> , "Alex Harui" <aharui@> wrote:
> >
> > Button icons cannot be loaded at runtime. They must be embedded
in
> the
> > app.
> >
> >
> >
> > ________________________________
> >
> > From: [email protected] <mailto:flexcoders%
40yahoogroups.com>
>
> [mailto:[email protected] <mailto:flexcoders%
40yahoogroups.com>
> ] On
> > Behalf Of mazarflex
> > Sent: Thursday, May 31, 2007 10:29 AM
> > To: [email protected] <mailto:flexcoders%
40yahoogroups.com>
> > Subject: [flexcoders] create new button with an icon
> >
> >
> >
> > i have created the buttons and ran them through a Stored
Procedure
> to
> > set visibility. now i am tring to asign the icons dynamically. i
> cannot
> > get it to work with the set style. not sure how to assign icons @
> run
> > time. heres the funciton calling from an array of buttons. it
does
> not
> > work. it will create the button but not the icon
> >
> > CreateIt(cmds[1],cmds[1].icon)
> >
> > public function CreateIt(l_cmdID:Button,l_filePath:String):void{
> > var l_cmdID:Button = new Button
> > l_cmdID.setStyle("icon",l_filePath)
> > this.HB1.addChild(l_cmdID)
> > }
> >
>