While running following code ,I got the error message as below,
function urlLoader_complete(evt:Event)
{
XMLdata=(evt.target.data).toString();
XMLdata=XMLdata.split("<").join("<");
XMLdata=XMLdata.split(">").join(">");
xml=new XML(XMLdata);
**fnctn();**
}
function fnctn()
{
var tp:int = bulb1 + bulb2 + bulb3 + bulb4;
if(tp == 1)
{
**gep.addItem(new Object());**
gep[gep.length-1].voltage1 =evt.result.Array.Voltage.Val;
gep[gep.length-1].current1 = evt.result.Array.Current.Val;
gep[gep.length-1].voltage2 = 0;
gep[gep.length-1].current2 = 0;
gep[gep.length-1].voltage3 = 0;
gep[gep.length-1].current3 = 0;
gep[gep.length-1].voltage4 = 0;
gep[gep.length-1].current4 = 0;
}
Error is
ReferenceError: Error #1065: Variable evt is not defined.
at vi_fla::MainTimeline/fnctn()[vi_fla.MainTimeline::frame2:449]
at vi_fla::MainTimeline/urlLoader_complete()[vi_fla.MainTimeline::frame2:436]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()
The two lines with errors are marked in the above code…what will be the reason for this error?
***UPDATE********
Now I have modified the code as below.
function fnctn(evt:Event)
{
var tp:int = bulb1 + bulb2 + bulb3 + bulb4;
if(tp == 1)
{
ChartDataProvider1.push(xml.Value.Array.Voltage.Val.text())
ChartcategoryNames.push();
trace("value= "+xml.Value.Array.Voltage.Val.text())
}
}
Now there is no error while running,But trace value shows no values. It shows as Value=
How this problem can be solved?
*******UPDATE**************
I modified code as below
var ChartcategoryNames:Array=new Array();
var ChartDataProvider1:Array=new Array();
var lineArray1:LineSeries=new LineSeries();
if(tp == 1)
{
ChartDataProvider1.push(xml.graph.Voltage.text());
ChartcategoryNames.push();
trace("hi= "+xml.graph.Voltage.text());
yAxis = new NumericAxis();
yAxis.maximum=10;
yAxis.minimum=0;
yAxis.majorUnit=2;
Exp_Content.input_mc.in_graph.verticalAxis=yAxis;
//Exp_Content.input_mc.in_graph.dataProvider=ChartDataProvider1
lineArray1.dataProvider=ChartDataProvider1;
}
Now the trace hi shows correct values,which is also seen in ChartDataProvider1.But lineArray1 does not have any values…Please suggest a solution for this problem..
You need to pass your event around: