[osflash] problem with 'super' in class inheritance

Richard Leggett rleggett at gmail.com
Thu Oct 6 14:02:20 PDT 2005


I'm assuming there is a "function" before the NewClass in your real code?
Does super() without args cause an error?

  _____  

From: osflash-bounces at osflash.org [mailto:osflash-bounces at osflash.org] On
Behalf Of Rob Bateman
Sent: 06 October 2005 21:59
To: Open Source Flash Mailing List
Subject: [osflash] problem with 'super' in class inheritance


I managed to switch from my beta copy of flash 8 to the real deal today, and
as i've now come to expect with flash software updates, the project i was
working on instantly stopped compiling. the problem wasn't too severe tho -
but it was a little odd hence my reason for posting it here:

generally extending a core class (or any class for that matter) will involve
writing a new class with an empty constructor. The reason? class
constructors automatically call their superclass constructor, unlike methods
which need a super.method() written inside them if their superclass method
is to be executed. However, how do you deal with constructors that need to
pass arguments? The way i was doing it was as follows:

NewClass extends MMClass {
     NewClass(arg)
     {
          super(arg);
     }
}

but this doesn't wash with the new error checking in the flash 8 ide. When
the MMClass in question is the TextFormat class (as was the case with my
code), the following error appears

there is no method called 'super'

This shouldn't be happening, right?

Rob

-- 
~~~~~~~~~~~~~~~~~~~~~~~~
Rob Bateman - Flash Product Manager
BBC News Interactive

Tel: 0208 6248692
Mob: 07714 329073

rob.bateman at gmail.com
~~~~~~~~~~~~~~~~~~~~~~~~ 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/osflash_osflash.org/attachments/20051006/a6c31425/attachment.htm


More information about the osflash mailing list