Some chart elements fails when using FABridge


hi,

hit following error when trying create chart using javascript , fabridge:

#0: function createchart() in < http://localhost:8080/fabridge2/samples/fabridgesample4.html> line 39
037: var flexapp = fabridge.example.root();
038: if (flexapp.getpanel().getchildbyname("chart") == null) {
039: var chart = fabridge.example.create("mx.charts.linechart");
040: chart.setname("chart");
041: var dtaxis = fabridge.example.create("mx.charts.datetimeaxis");
continuing breakpoint.
#0: function anonymous(classname=string:"mx.charts.linechart") in < http://localhost:8080/fabridge2/src/bridge/fabridge.js> line 233
233: return this.deserialize(this.target.create(classname));
#0: function anonymous(packedvalue=string:"__flasherror__||error #1065: variable linechart not defined.") in < http://localhost:8080/fabridge2/src/bridge/fabridge.js> line 472
472: var result;
#0: function anonymous(packedvalue=string:"__flasherror__||error #1065: variable linechart not defined.") in < http://localhost:8080/fabridge2/src/bridge/fabridge.js> line 474
474: var t = typeof(packedvalue);
#0: function anonymous(packedvalue=string:"__flasherror__||error #1065: variable linechart not defined.") in < http://localhost:8080/fabridge2/src/bridge/fabridge.js> line 475
475: if (t == "number" || t == "string" || t == "boolean" || packedvalue == null || packedvalue == undefined)
#0: function anonymous(packedvalue=string:"__flasherror__||error #1065: variable linechart not defined.") in < http://localhost:8080/fabridge2/src/bridge/fabridge.js> line 477
477: result = this.handleerror(packedvalue);
#0: function anonymous(value=string:"__flasherror__||error #1065: variable linechart not defined.") in < http://localhost:8080/fabridge2/src/bridge/fabridge.js> line 533
533: if (typeof(value)=="string" && value.indexof("__flasherror")==0)
#0: function anonymous(value=string:"__flasherror__||error #1065: variable linechart not defined.") in < http://localhost:8080/fabridge2/src/bridge/fabridge.js> line 535
535: var myerrormessage = value.split("||");
#0: function anonymous(value=string:"__flasherror__||error #1065: variable linechart not defined.") in < http://localhost:8080/fabridge2/src/bridge/fabridge.js> line 536
536: if(fabridge.refcount > 0 )
#0: function anonymous(value=string:"__flasherror__||error #1065: variable linechart not defined.") in < http://localhost:8080/fabridge2/src/bridge/fabridge.js> line 540
540: throw new error(myerrormessage[1]);

i able create typical columnchart no problem. fabridge appears fail recognize
classes such "mx.charts.linechart" , "mx.charts.datetimeaxis".

here html code:

<!doctype html public "-//w3c//dtd xhtml 1.0 strict//en"
" http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd">

<!--
copyright 2006 adobe systems incorporated

permission hereby granted, free of charge, person obtaining copy of software , associated documentation files (the "software"),
to deal in software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of software, , permit persons whom software furnished so, subject following conditions:

above copyright notice , permission notice shall included in copies or substantial portions of software.


the software provided "as is", without warranty of kind, express or implied, including not limited warranties of merchantability,
fitness particular purpose , noninfringement. in no event shall authors or copyright holders liable claim, damages or other
liability, whether in action of contract, tort or otherwise, arising from, out of or in connection software
or use or other dealings in software.

-->
<html>
<head>
<title>flex-ajax bridge example</title>
<script src="../src/bridge/fabridge.js" ></script>
<script src="fabridgesample.js" ></script>
<script>

function createchart() {
var flexapp = fabridge.example.root();
if (flexapp.getpanel().getchildbyname("chart") == null) {
var chart = fabridge.example.create("mx.charts.linechart");
chart.setname("chart");
var dtaxis = fabridge.example.create("mx.charts.datetimeaxis");
chart.sethorizontalaxis(dtaxis);
var s1 = fabridge.example.create("mx.charts.series.lineseries");
s1.setxfield("date");
s1.setyfield("px");
chart.setseries( [s1] );
chart.setwidth(400);
chart.setheight(300);
flexapp.getpanel().addchild(chart);
}
}

function filldata1() {
var flexapp = fabridge.example.root();
var chart = flexapp.getpanel().getchildbyname("chart");
var dp = ........
chart.setdataprovider(dp);

}

</script>
</head>
<body scroll="no">
<input type="button" onclick="createchart();return false;" value="render chart" />
<input type="button" onclick="filldata1();return false;" value="filldata1" />
<div id="container">
<div id="flashoutput">
<noscript>
<object id="flexapp" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase=" http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,5,0,0" height="800" width="800">
<param name="flashvars" value="bridgename=example"/>
<param name="src" value="app.swf"/>
<embed name="flexapp" pluginspage=" http://www.macromedia.com/go/getflashplayer" src="app.swf" height="400" width="400" flashvars="bridgename=example"/>
</object>
</noscript>
<script language="javascript" charset="utf-8">
document.write('<object id="flexapp" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase=" http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,5,0,0" height="800" width="800">');
document.write('<param name="flashvars" value="bridgename=example"/>');
document.write('<param name="src" value="app.swf"/>');
document.write('<embed name="flexapp" pluginspage=" http://www.macromedia.com/go/getflashplayer" src="app.swf" height="500" width="600" flashvars="bridgename=example"/>');
document.write('</object>');
</script>
<br>
<br>
</div>
</div>
</body>
</html>

your appreciated. thanks.

regards,
howard

make sure import appropriate classes in mxml file , reference them @ least once. if don't reference classes, compiler 'optimize' throwing out classes not being used...


<?xml version="1.0" encoding="utf-8"?>
<mx:application layout="absolute" width="100%" height="100%" framerate="12" pagetitle="graph sample" xmlns:mx=" http://www.adobe.com/2006/mxml">
<fab:fabridge xmlns:fab="bridge.*" />
<mx:script>
<![cdata[
import mx.charts.*;
import mx.charts.series.*;
import mx.charts.effects.*;
import mx.controls.alert;
public var refs:array = [columnchart, columnseries, barchart, barseries, linechart, lineseries, piechart, pieseries, seriesinterpolate, datetimeaxis, legend, alert];
]]>
</mx:script>
</mx:application>


More discussions in Flex (Read Only)


adobe

Comments

Popular posts from this blog

Joomla site hacked, cant see front and - Joomla! Forum - community, help and support

Christian Home School Programs - Joomla! Forum - community, help and support

Trouble with PF_OutFlag_I_USE_AUDIO and PF_CHECKOUT_LAYER_AUDIO