Hi Harry, Unfortunately the icon can’t take an
instance, it can only take a class. I’ve filed an enhancement request
for skins to take something like a factory so that you could do this sort of thing.
I’m not hopeful for 2.0 though L You might need to provide the manipulated icon and embed it
yourself. Matt From: Hi, I try to manipulate the Icon of a subclass of a
Linkbutton to generate a disabledIcon. Could anyone help me, to convert an
Image to a Class to set as a disabled Image? Harry
public class LinkButtonEx extends LinkButton {
private var _DisabledImage:Image;
public override function setStyle(styleProp:String, newValue:*):void {
super.setStyle(styleProp, newValue);
if ( styleProp == "icon" ) {
if( _DisabledImage == null ) {
_DisabledImage = new Image();
this.addChild(_DisabledImage);
}
_DisabledImage.source = newValue;
this.callLater(_DisabledIconLoaded);
}
}
private function _DisabledIconLoaded():void {
_DisabledImage.content.blendMode = BlendMode.ERASE;
// doing some Bit
super.setStyle("disabledIcon",
_DisabledImage); // I get an error here
}
public function LinkButtonEx() {
super();
}
} Harald Dehn Gutzkowstraße 27 60594 Frankfurt Tel +49
(69) 61002712 Fax +49
(69) 15049656 Mobil +69 (151)
17887510
|