English 中文(简体)
mx:Application in Flex 4 Gumbo (beta 2) has padding around the border, I do not want any padding
原标题:

When I make a new Flex application in Flex 4 beta 2 (Flash Builder), then it creates a border around the outside of the Panel in this example of a thick width. It places a border with a shadow on the bottom and on left and right but not top. I want NO BORDER please.

I must use mx:Application because of some older Flex 3 libraries which require it, cannot use spark.

<?xml version="1.0" encoding="utf-8"?><mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
  xmlns:s="library://ns.adobe.com/flex/spark" 
  xmlns:mx="library://ns.adobe.com/flex/halo" minWidth="1024" minHeight="768">

最佳回答

The mx.core.Application differs in a few ways from the new spark.components.Application. It seems that the mx.core.Application has an inheritedStyle for the paddings of 24. A quick mx.utils.ObjectUtil.toString() of the Application s inheritingStyles shows that. Spark Applications have no padding.

If you set the padding(left|right|top|bottom) to 0, the first part is solved.

The PanelSkin also has a DropShadow applied to it. This is not included in the padding calculations, so if you just copy-paste the PanelSkin and remove the drop shadow part, that ll be fixed.

Here s the code for the app...


<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark"
    xmlns:mx="library://ns.adobe.com/flex/halo"
    paddingLeft="0" paddingRight="0" paddingTop="0" paddingBottom="0"
    creationComplete="{create()}">
    <fx:Script>
        <![CDATA[
            import mx.utils.ObjectUtil;
            public function create():void
            {
                var styles:Object = this.inheritingStyles;
                trace(ObjectUtil.toString(styles)); 
            }
        ]]>
    </fx:Script>
    <mx:Panel width="100%" height="100%" includeInLayout="true">
        <mx:Label text="test"/>
    </mx:Panel>
</mx:Application>

Hope that helps. Good luck.

问题回答

暂无回答




相关问题
Disable button tooltip in AS3

I want to disable the tooltip on certain buttons. The tooltip manager seems to be an all or nothing solution. Is it possible to disable the tooltip for just one or two buttons?

Multiple Remote call made simultenously

I was making multiple remote calls and they are done sequentially and when I am getting a result event back it s triggering calls to all the methods with ResultEvent as an argument . I am supposed to ...

Attaching a property to an event in Flex/AS3

I have a parameter that needs to be passed along with an event. After unsuccessful attempts to place it on the type by extending the class, I ve been advised in another SO question to write a custom ...

Clearing RSL in Cache

I have built a flex application which has a "main" project and it is assosciated with a few RSL s which are loaded and cached once i run my "main" application. The problem i am facing is that the ...

What s a good way of deserializing data into mock objects?

I m writing a mock backend service for my flex application. Because I will likely need to add/edit/modify the mock data over time, I d prefer not to generate the data in code like this: var mockData =...

AS3 try/catch out of memory

I m loading a few huge images on my flex/as3 app, but I can t manage to catch the error when the flash player runs out of memory. Here is the what I was thinking might work (I use ???? because i dont ...

热门标签