Hi, 

I'm using a runtime CSS to skin my app, but for some reason my buttons
won't resize according to the skin. I am not using scale9 since the
app is not resizable by the user and the button skin is a static image
loaded as a symbol from a .swf. The button remains squashed and
deformed, but if I create it using Actionscript and addChild, it works
perfectly.
I have tried loading the styles both after and before
creationComplete, using
StyleManager.loadStyleDeclarations("mySkin.swf") (a compiled CSS), but
nothing works.
The button uses styleName="myButton" as property, and in the CSS it
looks like this:

.myButton {
upSkin: Embed(source="styles.swf", symbol="btn_up");
disabledSkin: Embed(source="styles.swf", symbol="btn_disabled");
    overSkin: Embed(source="styles.swf", symbol="btn_over");
    downSkin: Embed(source="styles.swf", symbol="btn_over");
}
The mxml tag looks like this:
<mx:Button x="67" y="180" id="myButton" click="onClick()"
styleName="myButton"/>

The skin is visible but distorted. As I don't know the size of the
button skin at runtime (possible to use other skins), I can't set the
size initially. This works fine however (ie looks the way it should):

var btn:Button = new Button();
btn.styleName = myButton;
btn.x = 85;
btn.y = 80;
addChild(btn); 

I've been looking at examples that work fine using the exact same
technique, what is the problem?

Regards

Reply via email to