Sprite load image from URL sometimes work sometimes dont?

Not favoritedFavorited Favorited 0 favourites
  • 4 posts
From the Asset Store
_______ Huge collection of metal fixtures ________
  • Dear all,

    I'm trying to load image from URL into sprite object, google and downloaded an c3p file to learn and try, however I find that some URL work some don't, couldn't figure out why, all URL I try are https with valid cert, can anyone help me on this?

    Thanks a lot

    THIS is the c3p file I downloaded and modified a little bit to test, its from another Construct user in the forum but I cant find the post again

    I tried to load URL image from "https://i.postimg.cc/tg7gpFcN/p-stand.png" and "https://alexleung.name/test/p_stand.png", both are same image but the second link cannot be loaded

  • added a screenshot about the issue

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • It depends on the server configuration - for security reasons servers have to specifically allow cross-domain requests. It's subject to the same rules as described in the AJAX manual entry section on cross-domain requests.

  • Thank you very much Ashley, will look into and setup the server allowing cross-domain requests.

    from what I have google:

    1. install a2enmod

    sudo apt-get update

    sudo apt-get install apache2 libapache2-mod-wsgi

    2. then modify /etc/apache2/apache2.conf

    add Header set Access-Control-Allow-Origin "*" inside <Directory /var/www/html>

    3. Run following:

    a2enmod headers

    /etc/init.d/apache2 restart

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)