Skip to main content
Participating Frequently
March 18, 2008
Question

override & different packages?

  • March 18, 2008
  • 2 replies
  • 215 views
Hello.

I've having a problem overriding a method while extending a class whose parent class resides in another package.

My desire is to create a subclass based on the super class Calendar, but located in another package.

Unfortunately I'm only able to override the 'dosomething' method if I make it public [inside Class] or putting ExtendedCalendar in the same folder as Calendar [wich I dont want to...]. Any thoughts?

package utils1 {

public class Calendar {

public function Calendar(){
dosomething();
}

internal function dosomething():void {
. . .
}
}
}

//this will give me the following error:
//"1020: Method marked override must override another method."

package utils2 {

import utils1.Calendar;

public class ExtendedCalendar extends Calendar {

public function ExtendedCalendar (){
super();
}

override internal function dosomething():void {
. . .
}
}
}

Thanks in advance,
T.



This topic has been closed for replies.

2 replies

PluraAuthor
Participating Frequently
March 19, 2008
thanks. that seems better than using public.
Inspiring
March 19, 2008
If you don't want the method to be public, use the "protected" attribute
instead.