0 Replies Latest reply on May 26, 2009 12:32 PM by ToddBruner

    Error #1034 with LineSeries

    ToddBruner

      I'm developing a small flex app using Flex builder 3 on Mac OS X (10.5).  The application worked but I upgraded my flash to get the debugging capability to Flash 10 debugging.  Now I'm getting the following error:

       

      TypeError: Error #1034: Type Coercion failed: cannot convert mx.core::ClassFactory@2f618ce1 to mx.core.IFactory.
          at mx.charts.series::LineSeries/updateDisplayList()[C:\Work\flex\dmv_automation\projects\dat avisualisation\src\mx\charts\series\LineSeries.as:893]
          at mx.core::UIComponent/validateDisplayList()[E:\dev\3.0.x\frameworks\projects\framework\src \mx\core\UIComponent.as:6214]
          at mx.managers::LayoutManager/validateDisplayList()[E:\dev\3.0.x\frameworks\projects\framewo rk\src\mx\managers\LayoutManager.as:602]
          at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\3.0.x\frameworks\projects\frame work\src\mx\managers\LayoutManager.as:657]
          at Function/http://adobe.com/AS3/2006/builtin::apply()
          at mx.core::UIComponent/callLaterDispatcher2()[E:\dev\3.0.x\frameworks\projects\framework\sr c\mx\core\UIComponent.as:8460]
          at mx.core::UIComponent/callLaterDispatcher()[E:\dev\3.0.x\frameworks\projects\framework\src \mx\core\UIComponent.as:8403]

       

      Here are the code snippets:

       

      statscroller.mxml

       

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application
          xmlns:mx="http://www.adobe.com/2006/mxml"
          creationComplete="init();"
          layout="absolute">
         
          <mx:Script>
              <![CDATA[
                  import mx.graphics.IStroke;
                  private var uStroke:IStroke;
                  [Bindable] public var graphs:Array = new Array();
                             
                  public function init():void {
                      populate();
                     
                      sc1.url = String(graphs[0].url);
                      sc1.loadModule();
                      sc2.url = String(graphs[1].url);
                      sc2.loadModule();
                  }
                  public function populate():void {
                      graphs.push({
                          title:    "stuff from XX",
                          url:    "modules/scrollingChart.swf?type=bycountry&key=country&value=XX"
                      });
                      graphs.push({
                          title:    "stuff fromYY.",
                          url:    "modules/scrollingChart.swf?type=bycountry&key=country&value=YY"
                      });
                  }
              ]]>

          </mx:Script>

         
          <mx:VBox>
            
              <mx:Panel
                  id="chartPanel"
                  title="Chart One"
                  width="1400"
                  height="300">
                  <mx:ModuleLoader
                      id="sc1"
                      width="100%"
                      height="100%"
                      showEffect="{wl}"/>
              </mx:Panel>
              <mx:Panel
                  id="chartPanel2"
                  title="Chart Two"
                  width="1400"
                  height="300">
                  <mx:ModuleLoader
                      id="sc2"
                      width="100%"
                      height="100%"
                      showEffect="{wl}"/>
              </mx:Panel>
          </mx:VBox>

      </mx:Application>

       

      modules/scrollingChart.mxml

       

      <mx:Module
          xmlns:mx="http://www.adobe.com/2006/mxml"
          layout="absolute"
          creationComplete="moduleInit();"
          width="100%"
          height="100%">
         
          <mx:Script>
              <![CDATA[

                 // parsing methods for the xml data omitted for brevity

                ]]>
          </mx:Script>     

      <mx:Model id="colors">
              <root>
                  <dark_blue>0x20548a</dark_blue>
                  <dark_grey>0x010101</dark_grey>
                    <blue>0x003366</blue>
                    <light_blue>0x527eab</light_blue>
                    <green>0x4f7c2e</green>
                    <orange>0xef9f21</orange>
                    <red>0xff0000</red>
                    <yellow>0xFFFF00</yellow>
                    <khaki>0xF0E68C</khaki>
              </root>
          </mx:Model>
         
          <mx:Style>
              CartesianChart {
                  color:#ffffff;
              }
          </mx:Style>
         
          <mx:HTTPService
              id="dataService"
              url="{webService}"
              resultFormat="e4x"
              result="resultsHandler(event);"
              fault="faultHandler(event);"
          />
         
         
          <mx:VBox
              verticalGap="0"
              width="100%"
              height="100%"
              verticalScrollPolicy="off"
              horizontalAlign="right"
              paddingLeft="0"
              paddingTop="0"
              paddingBottom="0"
              paddingRight="0"
              bottom="0"    >
             
              <mx:CartesianChart
                  id="bigChart"
                  dataProvider="{zoomValues}"
                 
                  width="100%"
                  height="100%"
                  showDataTips="true"
                  dataTipMode="single"
                  paddingLeft="0"
                  paddingTop="0"
                  paddingBottom="0"
                  paddingRight="0"
                  dataTipFunction="dtFunction">
                 
                  <mx:fill>
                      <mx:SolidColor color="{colors.dark_grey}" alpha=".8" />
                  </mx:fill>

       

                   <mx:verticalAxis>
                          <mx:LinearAxis
                              title="Detections" 
                              minimum="{graphMin}"
                              maximum="{graphMax+1}" />
                   </mx:verticalAxis>
                   <mx:horizontalAxis>
                  <mx:DateTimeAxis
                      title="From {startTimeDate.toDateString()} to {endTimeDate.toDateString()}"
                      dataUnits="hours" />
                  </mx:horizontalAxis>
         
                  <mx:series>
                  <mx:LineSeries
                      name="HistLine"
                      form="curve"
                      xField="period_msse"
                      yField="mean">
                      <mx:lineStroke>
                          <mx:Stroke
                              color="{colors.red}"
                              weight="2" />
                      </mx:lineStroke>
                  </mx:LineSeries>
                 <mx:AreaSeries
                      name="Upper1"
                      id="upper1"
                      xField="period_msse"
                      yField="upper1"
                      minField="mean"
                      form="curve"
                      areaStroke="{new Stroke(colors.red, 1, 0.7)}"
                      areaFill="{new SolidColor(colors.red, 0.2)}" />
                    <mx:AreaSeries
                      name="Lower1"
                      id="lower1"
                      xField="period_msse"
                      minField="mean"
                      yField="lower1"
                      form="curve"
                      areaStroke="{new Stroke(colors.red, 1, 0.7)}"
                      areaFill="{new SolidColor(colors.red, 0.2)}" />

                <mx:LineSeries
                      name="MainLine"
                      form="curve"
                      xField="period_msse"
                      yField="value">
                      <mx:lineStroke>
                          <mx:Stroke
                              color="{colors.khaki}"
                              weight="3" />
                      </mx:lineStroke>
                  </mx:LineSeries>
              </mx:series>
             
          </mx:CartesianChart>
          </mx:VBox>
      </mx:Module>

       

      Any help would be greatly appreciated!

       

      Thanks,

      Todd