• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

HTML5 Asynch load/save event

J

jaber

Guest
Hi,
I want to trig some code after loading an image from web to a sprite is finished; for that I have created an empty room and an object and I am doing simple experiment:

in the obj create event

back = sprite_add("https://xxxxxxxxx.s3.amazonaws.com/01.png", 0,0, 0, 0, 0);



then in the Asynch load/save event
GML:
if ds_map_find_value(async_load, "id") == back
   {
show_message("done");
   if ds_map_find_value(async_load, "status") >= 0
      {
      show_message("done");
   
      }
     
   }
and finally in the draw event
draw_sprite_ext(back, image_index, x, y, image_xscale, image_yscale, image_angle, image_blend, image_alpha);

I am getting the image loaded into the sprite and it is drown properly... but I am not getting any of the "done" messages showing! I am wondering how to trig a code after the image load is completed? any ideas
Thanks
 
Top