Answer the question
In order to leave comments, you need to log in
ActionScript 3 - "Call to a possibly undefined method"?
Hello, I started learning Flex, trying to simulate inheritance.
I use Adobe Flash Builder 4.6 under Windows 8.1 x64.
Here is the code (test.as file):
package
{
import flash.display.Sprite;
public class test extends Sprite
{
public function test()
{
}
}
internal class LivingThing
{
public function Breath():String
{
return "I can breath";
}
public function Eat():String
{
return "I can eat";
}
}
internal class Animal extends LivingThing
{
}
internal class Dolphin extends Animal
{
public function Dolphin() { }
}
}
protected function btnStart_clickHandler(event:MouseEvent):void
{
var d = new Dolphin();
richTB.text = "Dolphin eating: " + d.Eat() + " Dolphin breathing: " + d.Breath();
}
Answer the question
In order to leave comments, you need to log in
Everything was solved when I removed the test.as file from the package (perhaps the problem was that I had two files with the same names - test.as and test.mxml).
import Dolphin;
probably forgotten.
more correctly
var d:Dolphin = new Dolphin();
it's not for you to write haxe.
import Dolphin;
probably forgotten.
more correctly
var d:Dolphin = new Dolphin();
it's not for you to write haxe.
Flex is dead, don't waste your time.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question