Todays picture

Get help using Construct 2

Post » Tue Apr 12, 2016 6:03 am

Hi ...
How can I make a url call too pick and image from server depending
of the DATE .. lest says haveing 12 folders on server..

and images 01-31

Regards
Flemming
B
33
S
17
G
11
Posts: 350
Reputation: 8,695

Post » Tue Apr 12, 2016 11:23 am

you can use rex_date plugin to get Day&Month
(or you can use Browser object and ExecJs..)

so...if you have folder1,folder2...folder5...etc
and pic1.png,pic2.png..pic12.png..etc

you need to set url to something like this
Code: Select all
"http://example.com/folder"&Date.Month&"/pic"&Date.Date&".png"
probably...
Edit:
If you use for folder or picture 01,02,..09 format ...you need to use zeropad(number,2)
Image
I use XAMPP server in example so url start with "http://localhost/"
so..URL
Code: Select all
"http://localhost/folder04/pic12.png"

becomes
Code: Select all
"http://localhost/folder"&varMonth&"/pic"&varDay&".png"


maybe would be best if you share link of today dummy pic..for testing...
B
67
S
24
G
7
Posts: 1,518
Reputation: 11,072

Post » Thu Apr 14, 2016 10:19 am

Hi THANKS for reply :-)

Ive made a try with this but didnt seams to work ..
Then I just put in a Btn to load the image from a full url..
that dont work either

I see the image in core browser url ..

Then I read this..

viewtopic.php?f=178&t=168224&p=1021767&hilit=load+image+from+url#p1021767

viewtopic.php?f=147&t=170149&p=1023320&hilit=load+image+from+url#p1023320

Has something changed

I use R226

Cheers
B
33
S
17
G
11
Posts: 350
Reputation: 8,695

Post » Thu Apr 14, 2016 11:23 pm

did you export&upload your game on server?
oosyrag wrote:Capx would help troubleshoot. Image path correct? In quotes? Same domain?

works for me in r227..
B
67
S
24
G
7
Posts: 1,518
Reputation: 11,072


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 8 guests