var a:Sprite = someObj as Sprite; var b:IMyClass = someObj as IMyClass; a.addChild(button); var c:Profile = b.getProfileByID(12); a.x = a.y = 50; b.showProfilePhoto(c);