Quantcast
Channel: Adobe Community : All Content - Adobe Animate CC - General
Viewing all articles
Browse latest Browse all 13519

Toolkit for CreateJS after export instance names are not available in .name property of objects

$
0
0

Inside a loop I connect a single click eventlistener to multiple objects. Inside the event listener I need to know what Button or MovieClip is clicked on.

In AS3 I used event.target.name and it looks like createjs supports this because the property .name exists for all objects.

 

But the problem is that the name property is null in every object. I tried adding .name inside the exported js and that works, but to edit that file is not really an option.

 

I use this code for example :

 

for (i = 1; i <= 150; i++){

    myMC["childMC" + i].addEventListener("click",onChildClick);

}

 

function onChildClick(event){
   alert('clicked target' + event.target.name);

}

 

Is this a bug or something or better yet, is there a workaround?


Viewing all articles
Browse latest Browse all 13519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>