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

Flash CC HTML5 Get instance names on click?

$
0
0

I make escape games and often have lots of items in a scene each with flash instance names that on mouse over or mouse click make some event happen or some text is displayed.

I'm using Flash CC and HTML 5 output and cannot get it to output the instance names in the log, is this not possible? Can anyone suggest an alternative method of responding to lots of movieclips/buttons etc

Here's my test code:-

 

//stage.enableMouseOver(24);
var clicked = "";
var clickedname = "";


//NEED TO FIND OUT MOVIECLIP INSTANCE NAME??

var key1 = exportRoot.key1
//key1.name = "key1"

//console.log(key1ref.name)


stage.on("click", function (evt) {
   
    //clickedname = stage.getObjectUnderPoint(evt.stageX, evt.stageY)
    //clicked = evt.target
   
    clicked = evt.target
   
    console.log(clicked)
    //output result to log
   
    /*if (clicked == "key1"){
        console.log("clicked key 1")
    }*/
   
});


Viewing all articles
Browse latest Browse all 13519

Trending Articles



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