<?xml version="1.0" encoding="utf-8"?>
<s:Application name="test2"
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx">
<mx:Button width="500" height="500" />
</s:Application>
can make big square Button.
But
<?xml version="1.0" encoding="utf-8"?>
<s:Application name="test2"
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx">
<fx:Style>
@namespace mx "library://ns.adobe.com/flex/mx";
mx|Button {
width: 500;
}
</fx:Style>
<mx:Button />
</s:Application>
This doesn't work
And
<?xml version="1.0" encoding="utf-8"?>
<s:Application name="test2"
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx">
<fx:Style>
@namespace mx "library://ns.adobe.com/flex/mx";
mx|Button {
fontSize: 500;
width: 500;
}
</fx:Style>
<mx:Button label="test" />
</s:Application>
can extend button width 'just similar to text width'.
Thus I predict that Button's width can be defined by fontSize or icon. Button itself width cannot be change externally. But inline CSS only can change Button's width irregularly.
I think this is Adobe's bug. How do you thin about this and do you know something about this problem?
I may be corrected, but I believe inline CSS operates on the StyleManager
to pass operations to the SkinClass
using the ISimpleStyleClient
interface. IE using the .getStyle()
and .setStyle()
functions. Height and Width are not part of the StyleManager
they are properties of the DisplayObject
.
MXML allows you to mix calls to class properties and skin/style properties inline, but CSS doesn't