[Laszlo-dev] the type of the "sprite" instance var is different for LzView and LzText
Henry Minsky
henry.minsky at gmail.com
Mon Jan 7 15:41:51 PST 2008
In LzView, the "sprite" instance var is pointing to an instance of
LzSprite, whereas in LzText, it expects to talk to
an instance of LzTextSprite (which is a subclass of LzSprite).
LzText calls a number of LzTextSprite methods, such as in it's construct method:
this.sprite.__initTextProperties(args);
So in as3, you're not allowed to override a superclass's instance var
with a var of the same name but a different type.
This is a particular issue because I am not declaring LzSprite
dynamic, I want it to be a sealed class
in order to get the performance benefits.
So how should this be handled?
Should I cast it before each call, or declare another var with type
LzTextSprite and point the sprite var at it?
--
Henry Minsky
Software Architect
hminsky at laszlosystems.com
More information about the Laszlo-dev
mailing list