Jump to content

Dynamically load image


Recommended Posts

The project that I'm working on loads data from YouTube and inserts the data into widgets floating around the viewport. The problem that I'm having is when I build the widget with the data, I cannot get the thumbnail to load.


The widget extends sprite and I attempted to 


app.load.image('thumbnail', data.thumbnail);

var thumbnail = app.add.sprite(baseX, baseY, 'thumbnail');



However, I get the error that 'thumbnail' does not exist.


Is there a way load the image in the constructor and create the sprite?


It isn't feasible to preload the images since the data is loaded via Ajax as users type their search criteria.

Link to comment
Share on other sites


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...