Hello,
i have some oracle API by which i am able to generate web pages with some stats displayed by charts which can be viewed by the end clients.
But i am having trouble with one JS method which is being used for the dynamic update of the type of the chart.
I get “[B]v_embed_object is null or not an object
[CODE]<SCRIPT LANGUAGE=”JavaScript”>
function changeGraphType(p_graph_id,p_type){
v_value_url = “MyTestCharts.swf?p_chart_code=”+p_type;
v_chart_object = document.getElementById(p_graph_id);
v_movie_object = document.getElementById(“movie_”+p_graph_id);
v_embed_object = document.getElementById(“embed_”+p_graph_id);
v_movie_object.setAttribute(“value”,v_value_url);
v_embed_object.setAttribute(“src”,v_value_url);
}
</script>
I think it is quite obvious error for an expert but i am the complete newbie in JS.. ?
to make things simplier i can provide the full code of the generated page:
[CODE]
<HTML>
<BODY>
<SCRIPT LANGUAGE=”JavaScript”>
function changeGraphType(p_graph_id,p_type){
v_value_url = “MyTestCharts.swf?p_chart_code=”+p_type;
v_chart_object = document.getElementById(p_graph_id);
v_movie_object = document.getElementById(“movie_”+p_graph_id);
v_embed_object = document.getElementById(“embed_”+p_graph_id);
v_movie_object.setAttribute(“value”,v_value_url);
v_embed_object.setAttribute(“src”,v_value_url);
}
</script>
<div id=”switchCharts”>
<form id=”selectForm”>
<select onchange=”javascript:changeGraphType(‘DemoChart’,this.value);”>
<option value=”AR2DF”>2D Area Chart</option>
<option value=”BC2DF”>2D Bar Chart</option>
<option value=”CL2DF”>2D Column Chart</option>
<option value=”CL3DF”>3D Column Chart</option>
<option value=”DN2DF”>2D Doughnut Chart</option>
<option value=”PI2DF”>2D Pie Chart</option>
<option value=”PI3DF”>3D Pie Chart</option>
<option value=”LINEF”>Line Chart</option>
</select>
</form>
</div>
<div id=”chartdiv”>
<object classid=”clsid:D27CDB6E-AE6D-11cf-96B8-444553540000″ codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0″ width=”800″ height=”600″ id=”DemoChart” >
<param id=”movie_DemoChart” name=”movie” value=”MyTestCharts.swf?p_chart_code=AR2DF” />
<param id=”FlashVars_DemoChart” name=”FlashVars” value=”&dataURL=singleSeriesChartData.xml&chartWidth=800&chartHeight=600″>
<param id=”quality_DemoChart” name=”quality” value=”high” />
<embed id=”embed_DemoChart” src=”MyTestCharts.swf?p_chart_code=AR2DF” flashVars=”&dataURL=singleSeriesChartData.xml&chartWidth=800&chartHeight=600″ quality=”high” width=”800″ height=”600″ name=”DemoChart” type=”application/x-shockwave-flash” pluginspage=”http://www.macromedia.com/go/getflashplayer” />
</object>
</div>
</BODY>
</HTML>