i think its saying that if you need to cast an object to an interface :

function foo(someAnimal:Object)
{
        var dog:IDog = IDog(someAnimal);
}

you'll get an error, so dont declare someParameter as type Object, instead 
declare it using an interface :

function foo(someAnimal:IAnimal)
{
...

of course if you are really dealing with anything (which seems like a slightly 
dangerous situation) then perhaps you could just create an empty interface as a 
tag

interface IAnything
{
}

function foo(absolutelyAnything:IAnything)
{
...


Darren Cook wrote:
> I've been reading a set of Actionscript 2 coding standards (*) and am
> confused a bit by this one: do not use "Object" as return type (or
> parameter type) when the value can be of any type. This is because "the
> Macromedia compiler thinks that instances casted to interfaces are not
> of type Object".

_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org

Reply via email to