Button icons cannot be loaded at runtime.  They must be embedded in the
app.

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of mazarflex
Sent: Thursday, May 31, 2007 10:29 AM
To: flexcoders@yahoogroups.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)
}

 

Reply via email to