Hi,
I wrote this little test script (although it's in c#), which works on one of my sprite collections.
using UnityEngine;
using System.Collections;
public class SpriteLoad : MonoBehaviour {
public tk2dSpriteCollectionData mySpriteData;
void Start ()
{
int spriteID = mySpriteData.GetSpriteIdByName("eye");
GameObject go = new GameObject();
tk2dSprite.AddComponent(go, mySpriteData, spriteID);
}
}
So if you drag your sprite collection data object to mySpriteData and change the GetSpriteIdByName to "ball", does that work for you?
Also, are you using platform collections?