Jan
31
2011
Today, I create a chart application under Flex SDK 4 with Flash Builder 4, when I switch the chart MXML file from development mode to design mode, one error occurs - Design mode: Error during component layout. Choose Design > Refresh to refresh design mode.
After refresh many times, that error still exists. I remove the components to debug one by one, finally find that it lies in the chart component. I customize defined grid lines on the chart component, as shown below:
<?xml version="1.0" encoding="utf-8"?>
<mx:GridLines xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
gridDirection="both" horizontalStroke="{scs}" verticalStroke="{scs}">
<fx:Declarations>
<s:SolidColorStroke id="scs"
color="0xCCCCCC"/>
</fx:Declarations>
</mx:GridLines>
At first glance, there is no problem, why design mode is wrong? I think it's still another SolidColorStroke issue. As you know, since Stroke class is replaced with SolidColorStroke, there are a lot of bugs in it, see http://www.riafan.com/article/flex/flex4-lineseries-two-bugs.html for details.
However, if we use element tags to define the line style instead of attributes tags, there is no bug at all as shown below:
<?xml version="1.0" encoding="utf-8"?>
<mx:GridLines xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
gridDirection="both" horizontalStroke="{scs}" verticalStroke="{scs}">
<fx:Declarations>
<s:SolidColorStroke id="scs"
color="0xCCCCCC"/>
</fx:Declarations>
</mx:GridLines>
I think defining property is much more convenient way, fortunately, In Flash Builder Burrito this Bug has been fixed.
原文:http://www.riafan.com/article/flex/design-mode-error-using-flex-chart.html