Hi,

One,

titleIcon is not a style, it's a property.

Two,

It's of type Class, so this means you have to embed the icon.

Three,

You cannot in this incarnation of Flex dynamically load an icon into the
titleIcon slot.

Peace, Mike

The only workaround I see is create an assets class that embeds the icons,
use your xml to call the name of the property in that embeded class library
and set the titleIcon through that reference.


var iconName:String = [EMAIL PROTECTED];

var icon:Class = MyIconLibrary.getIcon(iconName);
titleWindow.titleIcon = icon;

Peace, Mike

On 12/15/06, pitziilu <[EMAIL PROTECTED]> wrote:

  I have this xml for example:
<item icon="myIcon.gif"/>

for every <item> I will add a TitleWindow to the Application, and I
need to set the titleIcon property. I tried it this way:

var iconSource:String = 'url("' + [EMAIL PROTECTED] + '")';
myTitleWindow.setStyle("titleIcon", iconSource);

even if I try to set it manually :
myTitleWindow.setStyle("titleIcon", 'url("myIcon.gif")' );
it doesn't work..
(I know it's not the path.. the path to the image is good, the method
is wrong)

What's the problem? and more important how can I solve it? (is it
because myIcon.gif is not loaded when I set the style?

thank you




--
Teoti Graphix
http://www.teotigraphix.com

Blog - Flex2Components
http://www.flex2components.com

You can find more by solving the problem then by 'asking the question'.

Reply via email to