HTML5 Asynch load/save event

jaber

Member
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