6 Replies Latest reply on Jun 27, 2013 12:20 AM by AMULI

    Trying to understand array references

    Marlene Level 1

      In composition.ready:

      var tileArray = new Array('ads', 'portfolio', logos', 'websites', 'oversize', directMail)

      for (var i = 0; i<5; i++){

                grayscaleArray[i] = getSymbol(tileArray[i]).$(tileArray[i]+'TileGS');


      In plain english this is what I want to do:

      I want to click on a grayscale tile (for example grayscaleArray("adsTileGS") and then show the "adsPortfolio" symbol that is living in the library


      So this is what I have done


      for (var i = 0; i<grayscaleArray.length; i++){

                          grayscaleArray[i].click (function( ) {


           var arrayIndex =  HOW DO I GET THIS?  //need to get the array key value from the grayscaleArray for the tile that was clicked

           var arrayCategory = tileArray[arrayIndex]; //should return "ads"

           createChildSymbol (arrayCategory + "Portfolio", "Stage");  //should show "adsPortfolio" symbol on stage