Al principio me gusto la idea... Gracias!!!
pero en la hora de mostrar la aplicación como embed no he encontrado forma pasar la ruta... deberia que pillar como parametro... por que las imágenes están en otro servidor.... y con este clase genera imágenes en "runtime"..pues aun no pilla la ruta de parametros...
despues de dar mil vueltas he hecho m componente y asi se puede hasta meter los swf como iconos
MButton.mxml
Código Flex :
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="{init()}"
buttonMode="true" useHandCursor="true" >
<mx:Script>
<![CDATA[
[Bindable]
public var iconWidth:Number = 18;
[Bindable]
public var iconHeight:Number = 18;
[Bindable]
public var textIndentButton:Number = 0;
[Bindable]
public var butEnabled:Boolean = true;
[Bindable]
public var iconSource:String = "";
[Bindable]
public var buttonStyleName:String = "";
[Bindable]
public var mButtonLabel:String = "";
public function setButtonStyle(str:String):void{
mButton.styleName = str;
}
public function cargarIco(str:String):void{
ico.load(str);
ico.addEventListener(Event.INIT,function (evento:Event):void{
});
}
private function init():void{
if(buttonStyleName != "") mButton.styleName = buttonStyleName;
if(mButtonLabel != "") mButton.label = mButtonLabel;
if(iconSource != "")ico.load(iconSource);
}
]]>
</mx:Script>
<mx:Button id="mButton" enabled="{butEnabled}" textIndent="{textIndentButton}" width="{this.width}" height="{this.height}" />
<mx:SWFLoader id="ico" height="{iconHeight}" width="{iconWidth}"
verticalCenter="0" rollOver="{mButton.selected = true}" rollOut="{mButton.selected = false}"
maintainAspectRatio="true" cacheAsBitmap="true"
left="2" />
</mx:Canvas>y después en aplicación
Código Flex :
<mx:Script>
<![CDATA[
private function loadIcons():void{
but1.cargarIco(skinUrl+'ico/type.gif');
but1.setButtonStyle("buttonStyle2");
}
]]>
</mx:Script>
<ns1:MButton id="but1" height="24" width="24" buttonStyleName="buttonStyle3" iconWidth="20" iconHeight="20"
toolTip="plugin Info Foto" click="{pluginInfoFoto()}" />