It’s probably because there is a difference between fixed properties and properties added at runtime. Fixed properties are variables, methods, or constants that you define as part of a class definition. These are fixed in the sense that you cannot remove them or replace them at runtime. That’s what Gordon was talking about.

 

A dynamic class, on the other hand, allows you to create objects that are not “sealed”, but does not allow you to alter fixed properties. It is true that an instance of a dynamic class can be modified at runtime, but only to the extent that you can add new properties or modify any new properties added at runtime. In other words, even in a dynamic class, you cannot alter a fixed property.

 

If you want to redefine properties at runtime, either don’t declare them as fixed properties or use prototype properties instead of fixed properties. You can read about the prototype object in the Advanced Topics section of Programming ActionScript 3.0, which is currently available here:

 

http://livedocs.macromedia.com/labs/1/flex20beta3/00001551.html

 

Francis

 


From: [email protected] [mailto:[email protected]] On Behalf Of polestar11
Sent: Thursday, June 08, 2006 6:32 AM
To: [email protected]
Subject: [flexcoders] Re: Help on Illegal assignment to function

 

Gordon wrote:
> 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.

In AS3 one should be able to change methods and properties at runtime
of dynamic classes:
"A dynamic class defines an object that can be altered at run time by
adding or changing properties and methods"

I am getting the same error (Illegal assignment to function) even
though the class is dynamic. Why would this be?

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to