I have a format that we use to create pie charts and i would like to create a
tool to generate the chart in the format we want just by passing 3 gradients of
each color to use. My pie chart calls a function on initialise that is
supposed to generate the colors for the pie chart. I have one chart hardcoded
with all values in my one mxml that works, but when I try to generate the chart
using actionscript I get a large black circle. When I go through the inspect
tags of both applications they look identical to me. Can someone shed some
light on this please.... Here is my code.......

My MXML:
<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml"
width="100%" height="100%"
initialize="srv.send()"
xmlns="*">
<Inspect/>
<mx:Script>
<![CDATA[
var myArray:Array =
[[255,52479,51],[39168,65280,13056],[16776960,16777062,16763904],[6684672,167116
80,3342336]];
]]>
</mx:Script>
<mx:Script source="buildChart.as"/>
<mx:HTTPService id="srv" url="regionsummary.xml"/>

<mx:Model id="results">{srv.result.data.region}</mx:Model>

<mx:PieChart id="chart" initialize="buildChart(myArray)"
dataProvider="{results}" showDataTips="true" width="100%" height="100%">

<mx:series>
<mx:Array>
<mx:PieSeries field="revenue" labelPosition="inside">
<mx:fills>
<mx:Array>
</mx:Array>
</mx:fills>
</mx:PieSeries>
</mx:Array>
</mx:series>
</mx:PieChart>
</mx:Application>

My AS:
function buildChart(myColors:Array)
{
var arrayLength:Number=myColors.length;
var myRatios:Array;
var calcRatios:Array;
var myAlphas:Array;
var i:Number = 0;
var n:Number = 0;
var myFills:Array;

while (i<=arrayLength-1)
{
var _entries = new Array();
var gstops = new Object();
gstops.colors=myColors;
calcRatios=[0,127.5,255];
gstops.ratios=calcRatios;
myAlphas=[100,100,100];
gstops.alphas=myAlphas;

myRatios=[20,100,0];
var entriesLength:Number=myRatios.length;
for(n=0;n<entriesLength;n++)
{
var entries = new Object();
entries.color=myColors[n];
entries.ratio=myRatios[n];
entries.alpha=myAlphas[n];
_entries.push(entries);
}
var Matrix = new Object();
Matrix.r=0
Matrix.h=544
Matrix.w=544
Matrix.y=4
Matrix.x=342
Matrix.matrixType="box"
this.chart.series[0].fills.push({gstops: gstops, _entries: _entries,
matrix: Matrix});
i++;
}
}