2 Replies Latest reply on Oct 4, 2015 2:19 AM by gbtrabzon

    How to make addEventListener and get the variable

    gbtrabzon

      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"
              }
          ]
      }