In AS3, if a class has declared a method at compile time, you can't reset that method at runtime to be a different function.
- Gordon -----Original Message----- From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of parinda_b_patel Sent: Wednesday, April 05, 2006 8:39 AM To: [email protected] Subject: [flexcoders] Help on Illegal assignment to function I am getting this compiler error:"Illegal assignment to function". I read the compiler error docs for Flex 2 which explains this error as error code 1168. But I do not understand how those 2 print statements in the explaination are different. Anyways so here is my code in which I am getting Illegal assignment to function error. package some.models{ public class DateRangeChartOptions{ public function reset(notify:Boolean):void { xMin = undefined; xMax = undefined; xInterval = undefined; yMin = undefined; yMax = undefined; yAutoAdjust = undefined; noteChanges(notify); } } ... } Now inside my other class which is in package some.controls as mxml class DateRangeChart I am trying to redefine the reset function as following: public function get options():DateRangeChartOptions { if (_options == undefined) { var scope = this; _options = new DateRangeChartOptions; _options.addEventListener("change",updateBandingDates); _options.reset = function(notify:Boolean):void { if (scope._banding && scope._maxY != scope._minY) { scope._options.yMax = scope._maxY; scope._options.yMin = scope._minY; scope._options.yAutoAdjust = false; } else { scope._options.yMax = undefined; scope._options.yMin = undefined; scope._options.yAutoAdjust = true; } scope._options.setDateRange( scope.pager.startDate, scope.pager.endDate,notify); } } return _options; } where _options has a public access. Now I am not sure why am I getting this error and what should I do to fix that. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

