johnatm / itween

Automatically exported from code.google.com/p/itween
1 stars 2 forks source link

Exception in method "public static int Count(string type)" #120

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

1. Pass a long string into iTween.Count(string)

What is the expected output? What do you see instead?

You get an exception

What version of the product are you using? On what operating system?

iTween Visual Editor version 0.6.1
Mac OS X 10.8.3

Please provide any additional information below.

I changed Count to the following  :-

    public static int Count(string type){
        int tweenCount = 0;

        for (int i = 0; i < tweens.Count; i++) {
            Hashtable currentTween = (Hashtable)tweens[i];
            string targetType = (string)currentTween["type"]+(string)currentTween["method"];
            targetType=targetType.Substring(0,(type.Length > targetType.Length) ? targetType.Length : type.Length);
            if(targetType.ToLower() == type.ToLower()){
                tweenCount++;
            }
        }   

        return(tweenCount);
    }           

Original issue reported on code.google.com by mark_r...@hotmail.com on 28 Mar 2013 at 12:41