Hi
Just a quick question is it possible to store multiple varying objects that all implement a single specific interface in a a Vector?
For instance
public interface IType
{
...
}
public class TypeA implements IType
{
...
}
public class TypeB implements IType
{
...
}
Which of these two cases would work if at all?
[SIZE=“3”][COLOR=“RoyalBlue”]CASE 1:[/COLOR][/SIZE]
...
var typeA:IType = new TypeA ();
var typeB:IType = new TypeB ();
var objectList:Vector.<IType> = new Vector.<IType> ();
objectList.push (typeA);
objectList.push (typeB);
...
[SIZE=“3”][COLOR=“RoyalBlue”]CASE 2:[/COLOR][/SIZE]
...
var typeA:TypeA = new TypeA ();
var typeB:TypeB = new TypeB ();
var objectList:Vector.<IType> = new Vector.<IType> ();
objectList.push (typeA);
objectList.push (typeB);
...
Thanks in advance to anyone who can help.