loading data from web service with ajax,not work cocoonjs :S

Discussion and feedback on Construct 2

Post » Wed Apr 30, 2014 9:25 pm

Hi i have this data service url:

http://servicedatosabiertosdesarrollo.c ... ormat=json

i am using it for loading some questions for mi game, it works good on web. But when i try it to run the app with cocoonjs on mobile it shows me the following error:

GET RESOURCE 'http://servicedatosabiertosdesarrollo.cloudapp.net/v1/Atencion_Reparacion_Integral_Victimas/setdatosjuego/?$format=json
'storage/emulate/0/Android/data/com.ideateca.cocoonjslauncher/files/vitimalz_game_optimizado/http:/servicedatosabiertosdesarrollo.cloudapp.net/v1/Atencion_Reparacion_Integral_Victimas/setdatosjuego

and the following warning:

Its´s recommended to use utf8 or utf16 encoding. Loaded "http://servicedatosabiertosdesarrollo.cloudapp.net/v1/Atencion_Reparacion_Integral_Victimas/setdatosjuego/?$format=json" with 'Proprietary' encoding.

is there someone that could help me? Thanks
B
9
S
4
Posts: 49
Reputation: 1,239

Post » Wed Apr 30, 2014 11:38 pm

Did you add a header to the file being served allowing ajax request from external domains? It might be being blocked by your server because the request came from a website that wasnt originally served by your server.

PHP example

header('Access-Control-Allow-Origin: *');
B
20
S
7
G
1
Posts: 221
Reputation: 2,077

Post » Thu May 01, 2014 1:35 am

Hi thanks
yes the Access-Control-Allow-Origin it's solved, in browser it works grate look i put a .capx with an example,
the ting is that when i try it on cooconjs it don't load the data but i don't know why.
You do not have the required permissions to view the files attached to this post.
B
9
S
4
Posts: 49
Reputation: 1,239

Post » Mon May 12, 2014 1:30 am

I'm having the same issue in cocoonjs. I am loading several hundred images as project files. Some of the images are coming through, while others aren't. I'm wondering if it has something to do with the number of images I am trying to load?

They load just fine in the cocoonjs launcher webview, but some of the images aren't loading at all in "Canvas/WebGL".
www.simbucket.com - HTML5 Science Simulations / https://www.airconsole.com/#!play=com.n ... obotrumble - Robot Rumble on AirConsole
B
48
S
14
G
20
Posts: 374
Reputation: 14,586

Post » Mon Jun 09, 2014 8:44 pm

Hi in my case it whas server side permissions issue.
In your case it can be memory manage problem, because on mobiles you have not enough ram space.
try with 2 or 3 images.
B
9
S
4
Posts: 49
Reputation: 1,239


Return to Construct 2 General

Who is online

Users browsing this forum: LaDestitute and 32 guests