To change the application icon use the
setAlternateIconName() function and pass the name of the icon you wish to use.
For example, if you added an icon named "AlternateIcon" to your application, you change it using:
To reset the icon to the primary icon, pass either an empty string or
null to this function:
Listen for Result
You can listen to two events to confirm the icon was changed after a call to
DynamicIconEvent.SETALTERNATEICON_SUCCESS: Dispatched if the icon was successfully changed;
DynamicIconEvent.SETALTERNATEICON_FAILED: Dispatched if there was an error changing the icon, check the
errorproperty on the event for more information;
The most common error is a missing icon file: "The file doesn't exist". This is caused because the icon wasn't correctly added to your application when repackaging.
You should expect this error if you are debugging / packaging directly from AIR.
Checking for Support
You can directly check whether the device supports changing the icon by checking the