Why do I need to do add extra namespace declarations (below) in a Flex 4.1 "MX only component set" project to get it to compile within Flash Builder? (It says mx:LineChart cannot be resolved when a chart is added via Design View, and datavisualization.swc is referenced.)
Is there a way I can get this to compile without adding these special xmlns:charts, xmlns:series and chartClasses to the declaration? (If I just leave the default namespaces and use mx:SomeChartComponent, it doesn't compile.)
<?xml version="1.0" encoding="utf-8"?>
<mx:VBox xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:charts="mx.charts.*"
xmlns:series="mx.charts.series.*"
xmlns:chartClasses="mx.charts.chartClasses.*">
<charts:PieChart id="chart" height="100%" width="100%"
paddingRight="5" paddingLeft="5" color="0x323232"
dataProvider="{medalsAC}" >
<charts:series>
<series:PieSeries labelPosition="callout" field="Gold">
<series:calloutStroke>
<s:SolidColorStroke weight="0"
color="0x888888" alpha="1.0"/>
</series:calloutStroke>
<series:radialStroke>
<s:SolidColorStroke weight="0"
color="#FFFFFF" alpha="0.20"/>
</series:radialStroke>
<series:stroke>
<s:SolidColorStroke color="0"
alpha="0.20" weight="2"/>
</series:stroke>
</series:PieSeries>
</charts:series>
I don't believe you can do it without defining the extra namespaces/packages. This is due to a change in the mx namespace when moving to Flex 4, the mx namespace is now defined as:
library://ns.adobe.com/flex/mx
it used to be:
http://www.adobe.com/2006/mxml
Here's more on namespaces: http://livedocs.adobe.com/flex/3/html/help.html?content=03_Language_and_Syntax_06.html
Basically using the old namespace should work for the charting code since it's defined with that namespace however then it would expect to find all the updated mx components with that namespace too which is where I think you'd be running into problems.