That error indicates that your are referencing something that doesn't exist
yet.

You need to set listeners of the swfloader(s) to ensure that they are loaded
and complete. See the doc's which has an example of setting them.

Wait for the complete event then fire your charting.

Post back if you need more help.

Angus

On 01/03/07, tyriker <[EMAIL PROTECTED]> wrote:

  I've built an application to display a dataset in a chart. The app
receives XML via an HTTPService on load, and displays the chart just
fine. So far so good.

Step two, I made a second app, and using the SWFLoader object, have
loaded the first app into 4 separate quadrants (so there's 4 instances
of the original app running inside the second app). If it matters, I
didn't embed the apps, but they are loaded at runtime.

When running this second app, about 95% of the time, I get a runtime
error and none of the charts show up. Once, I've had 1 chart show up,
and the other three not. And the other 5% of the time, all four will
load without error. To take out any other variables, I've used the
same dataset for all the charts, and the same dataset for all my
testing. The error that comes up is as follows:

------------------
TypeError: Error #1034: Type Coercion failed: cannot convert
mx.core::[EMAIL PROTECTED] to mx.core.IFactory.
at mx.charts.series::BarSeries/get legendData()
at mx.charts.chartClasses::ChartBase/get legendData()
at mx.charts::Legend/::populateFromArray()
at mx.charts::Legend/mx.charts:Legend::commitProperties()
at
mx.core::UIComponent/validateProperties
()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\UIComponent.as:5300]
at
mx.managers::LayoutManager/mx.managers:LayoutManager::validateProperties
()[C:\dev\flex_201_gmc\sdk\frameworks\mx\managers\LayoutManager.as:517]
at

mx.managers::LayoutManager/mx.managers:LayoutManager::doPhasedInstantiation
()[C:\dev\flex_201_gmc\sdk\frameworks\mx\managers\LayoutManager.as:667]
at Function/http://adobe.com/AS3/2006/builtin::apply()
at
mx.core::UIComponent/mx.core:UIComponent::callLaterDispatcher2
()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\UIComponent.as:7909]
at
mx.core::UIComponent/mx.core:UIComponent::callLaterDispatcher
()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\UIComponent.as:7852]
------------------

I've dug through the app with the debugger (Flex Builder 2) and
haven't come up with anything yet. To me, it looks like the problem is
occurring in a piece of code I don't have control over. And why it may
work 5% of the time, and in the next exact run give a runtime error
has me puzzled. It must be a timing thing, but I'm lost as to where to
even look.

Am I missing something here? Does anyone have any advice for me? I can
provide more details if needed.

Thanks everyone.

Reply via email to