0 Replies Latest reply on Sep 26, 2006 2:18 AM by cimaea

    how to find out if list data contains some text?

    cimaea
      hello everoboby

      i have a list which opens different files. I would like PDF files to be opened in a new window while other files to be opened in the same window. What code could I use to determine whethere the list data contains ".pdf"?

      This is what I have so far, but its not working:

      if (my_list.evt.target.selectedItem.data=".pdf") {
      my_list.change = function(evt:Object) {
      _root.getURL(evt.target.selectedItem.data, "_blank");
      };
      my_list.addEventListener("change", my_list);
      }
      else {
      my_list.change = function(evt:Object) {
      _root.getURL(evt.target.selectedItem.data);
      };
      my_list.addEventListener("change", my_list);
      }