CSS Class selector
.DeleteSkin{
upSkin: Embed(source=’assets/swf/Assets.swf#delete’, scaleGridLeft=10, scaleGridRight=25, scaleGridTop=5, scaleGridBottom=8);
overSkin:Embed(source=’assets/swf/Assets.swf#delete’, scaleGridLeft=10, scaleGridRight=25, scaleGridTop=5, scaleGridBottom=8);
downSkin:Embed(source=’assets/swf/Assets.swf#delete’, scaleGridLeft=10, scaleGridRight=25, scaleGridTop=5, scaleGridBottom=8);
skinClass: ClassReference(“assets.skins.ButtonSkin”);
}
ButtonSkin.mxml
<?xml version=”1.0″ encoding=”utf-8″?>
<s:SparkSkin xmlns:fx=”http://ns.adobe.com/mxml/2009″
xmlns:s=”library://ns.adobe.com/flex/spark”
xmlns:fb=”http://ns.adobe.com/flashbuilder/2009″
minWidth=”14″ minHeight=”14″
alpha.disabled=”0.5″>
<!– states –>
<s:states>
<s:State name=”up” />
<s:State name=”over” />
<s:State name=”down” />
<s:State name=”disabled” />
</s:states>
<!– host component –>
<fx:Metadata> <![CDATA[ [HostComponent(“spark.components.Button”)]]]></fx:Metadata>
<s:HGroup horizontalCenter=”0″ verticalCenter=”0″ verticalAlign=”middle” horizontalAlign=”center” left=”0″ right=”0″ top=”0″ bottom=”0″>
<s:BitmapImage
source.up=”{hostComponent.getStyle(‘upSkin’)}”
source.over=”{hostComponent.getStyle(‘overSkin’)}”
source.down=”{hostComponent.getStyle(‘downSkin’)}” width=”100%” height=”100%”/>
</s:HGroup>
</s:SparkSkin>
cooool
This is exactly what I need! Thanks!!
Unfortunately I can NOT get it to work. What needs to be done on the Flex side? In my case the symbol is not getting recognized.
I’m using Flash Builder 4.6 and Flask Professional CS5
@Robin.Hope you are new to flex. Usually you would be declaring your button component in flex as
s:Button styleName="DeteleButton"
use styleName property to call the declared style from css file or from inline style.Hi, no, actually I’m far from new to Flex. I’ve been working with it for the last 7 years. I can get the scale grid to work on images declared in Flex (in MXML, in CSS, or in a seperate image.as class).
The problem is
1 – when using a single swf containing symbols (instead of importing 10 seperate png files into Flex). Having a single swf would speed up the designer to developer process
2 – applying the scale 9 grid in Flash Pro by the designer and not having to code this in Flex.
Somehow both of these two things don;’t really seem to work well in AS3.
I think i had trouble with the flash document scale9Grid so i had to go with the css scale9Grid.
That’s what I’m noticing as well.
is there anything that needs to get done in Flash Professional CS5 to get the symbols recognized? I have an image in the Library and convert it to a symbol. I checked the Export to ActionScript field. The identifier used to represent the symbol name, but this field is greyed out since ActionScript 3…. Supposedly it should be the class name, but this hasn’t worked for me.
So in the end I had to export each symbol as a separate png after which everything works fine. However, this adds a lot of overhead. It would be best being able to stick to the swf as in your example. Any ideas?
its been long time since i worked with flash professional but i only had problem with the scale9Grid, not with the symbol class name to access it from flex. it was working fine for me..if this is your problem let me try this in my free time..