#42 optionalArgs@callExternalCallback doesn't work with 2+ param

version-2
open
nobody
None
5
2009-06-16
2009-06-16
No

the local function callExternalCallback (at main.as) receives two parameters. 1st, the function's name and 2nd, an optionalArgs. I dont code on AS, but it seems to behave like ParamArray on VB6.
Well.. it works fine when callExternalCallback is called with 2 parameters (almost everywhere in the code), but on lines 571 you might find:

ExternalInterface.call("ofc_resize", sc.left, sc.width, sc.top, sc.height, this.chart_parameters['id']);

and there's where the bug appears. all the parameters are sent into the first one. you can clearly see this here:

http://teethgrinder.co.uk/open-flash-chart-2/tutorial-jquery-resize.php

below chart, only 'LEFT' receives all the values. the rest remains 'undefined'

as a workaround, i replaced the code like this and it worked perfectly:

// tell the web page that we have resized our content
if ( this.chart_parameters['id'] )
ExternalInterface.call("ofc_resize", sc.left, sc.width, sc.top, sc.height, this.chart_parameters['id']);
//this.callExternalCallback("ofc_resize", sc.left, sc.width, sc.top, sc.height, this.chart_parameters['id']);
else
ExternalInterface.call("ofc_resize", sc.left, sc.width, sc.top, sc.height);
//this.callExternalCallback("ofc_resize", sc.left, sc.width, sc.top, sc.height);

good luck! if there are any questions, don't bother and email me!

Discussion


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks