|
From: Axel H. <ax...@3d...> - 2003-12-09 13:47:55
|
Hi!
Trying to extend the SWFButton class in php doesn't work as expected:
<?php
class A
{
function A()
{
echo "I am the constructor of A.<br>\n";
}
function bTest()
{
echo "I am a regular function named bTest in class A.<br>\n";
}
}
class A_A extends A
{
function alpha($a){
echo("A_A: ".$a."<br>");
}
}
class B extends SWFButton
{
function C()
{
echo "I am a regular function.<br>\n";
}
}
$a = new A_A();
$a->alpha('hello');
$a->bTest();
$cm = get_class_methods ($a);
$cName = get_class($a);
foreach ($cm as $method){
echo($cName.'::'.$method."()<br>");
}
$b = new B();
$cm = get_class_methods ($b);
$cName = get_class($b);
foreach ($cm as $method){
echo($cName.'::'.$method."()<br>");
}
$b->C();
$down = new SWFShape;
$b->setDown($down);
?>
This produces the following result:
I am the constructor of A.
A_A: hello
I am a regular function named bTest in class A.
a_a::a()
a_a::btest()
a_a::alpha()
a_a::a_a()
swfbutton::swfbutton()
swfbutton::sethit()
swfbutton::setover()
swfbutton::setup()
swfbutton::setdown()
swfbutton::setaction()
swfbutton::addshape()
swfbutton::setmenu()
swfbutton::addaction()
swfbutton::addsound()
Fatal error: Call to undefined function: c() in
e:\apache\apache\htdocs\php\classtest.php on line 43
I wonder why the class doesn't accept the extension?
Help,
Axel
|