Can someone explain what im doing wrong? I'm simply trying to set the icon for a button in a Flex Mobile project using actionscript. I keep getting a null error reference. But i'm 100% sure that is not a bad path. I've used the same path a dozen other times in the app.
var editCalloutBtn:CalloutButton = new CalloutButton;
if(value.type=="reminder")
{
//this is where the null error happens
editCalloutBtn.iconDisplay.source="assets/images/reminderIcon_45.png";
}else
{
editCalloutBtn.iconDisplay.source="assets/images/deadlineIcon_45.png";
}
callout_group.addElement(editCalloutBtn);
For a test, I set the icon using the same path doing everything in mxml, and it works. So it's not the path. But I need to do this with actionscript so I can set the value dynamically.
Any ideas?
iconDisplayis the correct attribute? can't find it in here: help.adobe.com/en_US/FlashPlatform/beta/reference/actionscript/… - Philipp Kyeck