Skip navigation
Currently Being Moderated

Toolkit for CreateJS instance name conflicts

Dec 2, 2012 2:44 PM

Tags: #flash #javascript #professional #html5 #publish #createjs #easeljs #toolkit_for_createjs

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?

 

Thanks

Aemon

 
Replies
  • kglad
    72,235 posts
    Jul 21, 2002
    Currently Being Moderated
    Dec 2, 2012 7:09 PM   in reply to Aemon Cannon

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

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 22, 2013 10:06 PM   in reply to Aemon Cannon

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

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

                if(!object.hasOwnProperty(property))

                {

                    var i=0;

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

                        {

                            i++;

                        }

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

                     {

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

                     }

     

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

     

     

                }

            }

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points