Dashcode - How to get button name from event?

In Dashcode, you can configure a handler for behavior in the inspector.

Here, the sample handler for the button presses the button that I named "mybutton1" in the inspector:

function myGetButtonName(event)
{
    var e = event.target;
    alert(e.id);
}

The problem is that when the button is pressed and a warning appears, it says that the button identifier is "DC_img1" and not "myButton1" (this is what is displayed in the inspector in the id field).

I assume that I am not accessing the correct identifier.

Does anyone know how to get the identifier displayed on the inspector attributes tab?

Thank!

+3
source share
1 answer

, , "id", Dashcode Inspector, CSS . .

, :

var x=event.currentTarget;
alert(x.id);

, , , . CSS .

+2

Source: https://habr.com/ru/post/1766879/


All Articles