2 Replies Latest reply on Mar 22, 2013 10:06 PM by dalste

    Toolkit for CreateJS instance name conflicts

    Aemon Cannon Level 1

      The toolkit seems to assign unique suffixes to like-named instances of the same symbol. Unfortunately it seems to ignore the local scope of the instance, and enforces uniqueness globally. So if I have a Wing named wing1 and a Wing named wing2, and each Wing instance has feather1 (a Feather), feather2, feather3.....  the toolkit will rename feathers in wing2 to feather1_2, feather2_2, feather3_3. 


      Any thoughts?




        • 1. Re: Toolkit for CreateJS instance name conflicts
          kglad Adobe Community Professional & MVP

          check the response (by g skinner) about fixing this bug in the next version of createJS:  http://forums.adobe.com/thread/1103024?tstart=0

          • 2. Re: Toolkit for CreateJS instance name conflicts

            for simple cases I run this function against the offending display objects, feel free to modify/expand.

            class.prototype.enforcePropertyToolkitFix= function(object,property){



                            var i=0;

                                while(!(object.hasOwnProperty(property + "_" +String(i))) && ( i < 100))




                             if(!object.hasOwnProperty(property + "_" + String(i)))


                                 throw (new Error("AbstractView::enforcePropertyToolkitFix - unable to resolve property"));



                            object[property] = object[property + "_" +String(i)];