Quantcast
Channel: Adobe Community : All Content - Edge Animate
Viewing all articles
Browse latest Browse all 9897

How to make addEventListener and get the variable

$
0
0

Hello,

 

  I am getting data from a json file and populating it in adobe edge but i couldn't get the id when i click the image ? how can i do this ?

 

 

$.getJSON("theshort.json",function(data){  var datam = data.urunler;  for (var i = 0; i < data.urunler.length ; i++){    var d = sym.createChildSymbol("mynames","Rectangle");  d.$("first").html(data.urunler[i].baslik);  d.$("last").html(data.urunler[i].icerik);  d.$("resim").html("<img src="+data.urunler[i].resim+" />");    d.$("resim").setVariable("durum",data.urunler[i].id);  }  AdobeEdge.Symbol.bindElementAction(compId, "stage", "Rectangle", "click", function(sym, e) {  alert(e.target.sym.getVariable("durum"));@  });


});

 

   you can find my json file below,

 

{    "urunler": [        {            "id": "24",            "baslik": "title 1",            "icerik": "Content area 1",            "resim": "https://placeholdit.imgix.net/~text?txtsize=20&txt=150×150&w=150&h=150",            "sira": "1"        },        {            "id": "25",            "baslik": "title 2",            "icerik": "Content Area 2",            "resim": "https://placeholdit.imgix.net/~text?txtsize=20&txt=150×150&w=150&h=150",            "sira": "2"        }    ]
}

Viewing all articles
Browse latest Browse all 9897

Trending Articles



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