samedi 25 février 2017

Save image loaded to my UILoader in AS3 in order to load it without internet connection

I've got some UIloader in my AS3 code that displays images via web link.

uiloader1.source = "http://ift.tt/2lSiSU6";
uiloader2.source = "http://ift.tt/2mqsjIj";

Once the user have open the app with an internet connection, I'd like him to be able to open it again without any internet connection but still have the possibility to display the images.

I thought about something like :

var savedImage:SharedObject;
savedImage= SharedObject.getLocal("ImagesFolder");

if (monitor.available || savedImage.data.images == "null") {

    uiloader1.source = "http://ift.tt/2lSiSU6";
    uiloader2.source = "http://ift.tt/2mqsjIj";

    savedImage.data.loader1 = uiloader1.source;
    savedImage.data.loader2 = uiloader2.source;

}

else {

    uiloader1.source = savedImage.data.loader1;
    uiloader2.source = savedImage.data.loader2;

}

But it doesn't work as it saves the link of the image and not the actual image.

Any idea how can I save the images into a file and told uiloader1.source and uiloader2.source to load them ?

Aucun commentaire:

Enregistrer un commentaire