I've developed a class to make it easier to display runtime-loaded icons in
Buttons and Trees etc.

Features include:

    * Displaying icons loaded at runtime in components that normally only
accept embedded icons
    * Displaying default embedded images when runtime icons cannot be loaded
    * Runtime icons can be resized as desired (if not specified then the
original size is used)
    * Embedded icons can also be resized

To give you an idea, this is how you might use runtime icons in a Tree:

var myTree:Tree = new Tree();
myTree.iconFunction = IconUtils.getTreeIconFunction(myTree,
iconPathFunction, iconWidth, iconHeight, DEFAULT_ICON_CLASS);

private function iconPathFunction(treeItem:Object):String {
   var iconPath:String = ...
   return iconPath;
}

I've put more info on my new blog here:

http://blog.flex.mark.carter.name

I hope this is useful to someone.

Any feedback, much appreciated.
-- 
View this message in context: 
http://www.nabble.com/Displaying-icons-loaded-at-runtime%2C-in-Buttons%2C-Trees-etc-tp17179354p17179354.html
Sent from the FlexCoders mailing list archive at Nabble.com.

Reply via email to