Example .as files:
class GameoverPanel extends UserInteractionPanel {
function GameoverPanel(controller:PanelController, panelObj:Object) {
// Call the super() constructor passing it the panel object.
super(controller,panelObj);//calls the constructor for the base calss
UserInteractionPanel
super.showText("hello from uipanel");//uses function from extended class
// Populate the panel contents.
populatePanel();
super.populatePanel();//uses function from extended class
}
public function populatePanel(){
trace("populated from gameoverpanel");
}
public function test(){
trace("hello");
}
class PanelController{
}
class UserInteractionPanel{
function UserInteractionPanel(cont:Object,panObj:Object){
trace("UIP constructor called");
}
function showText(sText){
trace("show text uip:"+sText);
}
function populatePanel(){
trace("populated from uipanel");
}
}
All I can think of is that there may be an error prior to the 'super'
one that flash is airbrushing.
Also try using :
super.constructor.apply(this, arguments);
for the constructor instead.
Neil
On 11/17/05, Tim Stickland <[EMAIL PROTECTED]> wrote:
> Hi Greg
> Thanks for the reply, but I don't think either of these are the issues.
> This is the constructor of UserInteractionPanel:
> public function UserInteractionPanel (controller:PanelController,
> panelObj:Object) {}
> And here's a version of GameoverPanel with all but the constructor removed:
> class GameoverPanel extends UserInteractionPanel {
> public function GameoverPanel(controller:PanelController, panelObj:Object) {
> // Call the super() constructor passing it the panel object.
> super(controller, panelObj);
>
> // Populate the panel contents.
> this.populatePanel();
> }
> }
> Any other ideas? I seem unable to ever create a project involving AS2
> classes without getting syntax errors when error checking. These often don't
> stop the classes compiling and the application running properly, but they're
> a pain.
> Cheers
> Tim
>
> On 11/17/05, Gregory_GOusable <[EMAIL PROTECTED]> wrote:
> >
> >
> > Check the following:
> > 1) class GameoverPanel extends UserInteractionPanel ...
> > Make sure you have "extends" word
> >
> > 2) To use super(controller, panelObj); , you must have 2 parameters
> > in the construstor of UserInteractionPanel class.
> >
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
--
www.neilhighley.com
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders