Hello,
I am creating a flash game. In this flash game the user has to estimate the weight of several products. I’ve created an interface for all ProductStacks to implement so i can take care of some stuff through calling the interface
package objects
{ /**
* ...
* @author Mark
*/
public interface IProductStack
{
function productScale():void;
function get amount():Number;
function get weight():Number;
}
}
And this is a class implementing the methods:
package objects.stacks
{
import miracle.utils.NumberUtils;
import objects.IProductStack;
import objects.ProductStack;
import flash.display.MovieClip;
/**
* ...
* @author Mark
*/
public class Bananas extends ProductStack implements IProductStack
{
public function get weight():Number
{
_weight = (!_weight) ? NumberUtils.ClamRandom(200, 300) : _weight;
return _weight;
}
/* INTERFACE objects.IProductStack */
public function productScale():void
{
}
}
}
The get method ‘amount’ is implemented in the base class ProductStack. I used to have only ‘amount’ and ‘weight’ methods in my interface before, but when i added scaleProduct i recieved this error for all products (while i implemented scaleProduct on all Products):
method not implemented objects::IProductStack/objects:IProductStack::productScale()
over-binding 0 in objects.stacks::Cucumbers
VerifyError: Error #1053: Illegal override of Cucumbers in objects.stacks.Cucumbers.
at global$init()