Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Loading online images

I'm trying to load images from an online host, like this:

    Ti.API.info("http://www.example.com/images/" + product.getName() + ".jpg");

    var image = Ti.API.createImageView({
        image: "http://www.example.com/images/" + product.getName() + ".jpg",
    });
    view.add(image);

Everytime I do this, my app crashes, I uploaded the error here: http://pastebin.com/2Fqkf8fz

It's a valid image, when I open it up in my browser, it shows up.
The image is 200x200

— asked November 7th 2010 by Wouter De Loose
  • external
  • image
  • images
0 Comments

1 Answer

  • Accepted Answer

    Hi Wouter

    Your error is in the command, var image = Ti.API.createImageView({}). It should be, var image = Ti.UI.createImageView({}).

    Cheers

    Hal

    — answered November 7th 2010 by Paul Dowsett
    permalink
    2 Comments
    • OMG, I totally overlooked that :(

      Thank you so much :)

      — commented November 7th 2010 by Wouter De Loose
    • That's ok Wouter. Would you mind marking this answer as correct?
      Thanks :)

      — commented November 7th 2010 by Paul Dowsett
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.