# So close... how to display images from RSS

**URL:** <https://discourse.processing.org/t/so-close-how-to-display-images-from-rss/11750>\
**Category:** Coding Questions\
**Created:** [May 31, 2019, 11:36pm UTC](https://discourse.processing.org/t/so-close-how-to-display-images-from-rss/11750 "2019-05-31T23:36:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Artie\_veirkant\_sux](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/artie_veirkant_sux/32/5283_2.png) [@Artie\_veirkant\_sux](https://discourse.processing.org/u/Artie_veirkant_sux)\
**Post date:** [May 31, 2019, 11:36pm UTC](https://discourse.processing.org/t/so-close-how-to-display-images-from-rss/11750/1 "2019-05-31T23:36:29Z")

</div>

Hey again,

Returning after some code tweaks, I still can’t get images to display from RSS. I’ve significantly refactored my code and have successfully created a tool for grabbing and loading images. The problem arises when trying to display the images; I don’t know how to access loaded images from a class.

Here’s my code for loading images:

```auto
let getImages = function(xml) {
  let items = xml.getChildren("item");
  for (let i = 0; i < 10; i++ ) {
    let URL = items[i].getChild('media:content');
    if (URL) {
      photos.push(URL.getString('url'));
    }
  }
  for (const k of photos) { 
    new thingTemp(loadImage(k));
    console.log(thingTemp.photos);
  }
};

```

and here’s the class I’m using:

```auto

class thingTemp {
  constructor(photos) {
    this.x = random(windowWidth), 
    this.y = random(windowHeight), 
    this.lifespan = 80, 
    this.photos = photos
  }

```

This is the method used to display the image:

```auto
  display () {
    tint(255, this.lifespan);
    //image(photos[0], windowWidth/2, windowHeight/2);
  }

```

Whenever I console.log(thingTemp.photos) I get “undefined.” Obv that’s problematic because I can’t display an image from a non-existent URL.

Any help would be much appreciated,  
Veirkant S.
