Start a new topic

ID property for Drawable objects

Hello and thank you for this great SDK. I mainly use the Cordova iOS/Android SDK.

In my App, the code draws a random number of HtmlDrawable objects on the screen.


When user clicks on one of the HtmlDrawable objects the "Click" event is triggered, but the code has no idea which HtmlDrawable was clicked.


The same happens when code draws multiple ImageDrawable, VideoDrawable and AnimatedImageDrawable objects on the screen.


Is it possible to add an "ID" property to these drawable classes so they are programmatically identifiable?



Good morning,

what do you mean by "no idea which HtmlDrawable was clicked"? If you implement the onClick callback of your HtmlDrawables you will get the callback for each of the instances separately, so you know exactly which drawable has been clicked on.

I'm by no means proficient in JavaScript, but my understanding is that, if you really wanted to have an ID as well, you could just add one to each of the HtmlDrawable instances and access it within the callback.

var h = new AR.HtmlDrawable(...);
h.myID = <some_value>;
h.onClick = function() {

- Daniel

1 person likes this
Thanks Daniel. Your answer provided the solution I was after.
Login or Signup to post a comment