Get handler to display.loadRemoteImage()

How do I get a handler to display.loadRemoteImage() so that I am able to cancel the download in the event there is a scene transition and I need to stop the download?

Thanks.

You could probably set a flag and when the call back listener dispose of what’s returned if you’re moved on.

Rob

Might have some issues if the user chooses to return back to the scene again immediately after exiting. Will it be more elegant if a handler is returned similar to network.request, network.download, etc?

Example, I set a flag to stop download and exit the scene. If the app re-enter the scene before the download is completed (very likely when the file size is big), the image will still be loaded.

Just a bit of history to set the context here.  Before we updated the network code to what we call “Network 2.0”, we did not have a network.cancel() API call.  One of the great things that happened with Network 2.0 was getting that feature.  The old network.request() API didn’t return anything, but now it does.

I wrote a quick test this morning to see if perhaps display.loadRemoteImage() was silently returning the requestId like the new network.* routines do, but it does not.  I’m asking engineering if this is something doable or not.  Since it’s just a convenience method around network.request() I would think this is something that we could do.

Lets see what they say.

Rob

Thanks Rob.  Hope to hear some good news soon.  :)

You could probably set a flag and when the call back listener dispose of what’s returned if you’re moved on.

Rob

Might have some issues if the user chooses to return back to the scene again immediately after exiting. Will it be more elegant if a handler is returned similar to network.request, network.download, etc?

Example, I set a flag to stop download and exit the scene. If the app re-enter the scene before the download is completed (very likely when the file size is big), the image will still be loaded.

Just a bit of history to set the context here.  Before we updated the network code to what we call “Network 2.0”, we did not have a network.cancel() API call.  One of the great things that happened with Network 2.0 was getting that feature.  The old network.request() API didn’t return anything, but now it does.

I wrote a quick test this morning to see if perhaps display.loadRemoteImage() was silently returning the requestId like the new network.* routines do, but it does not.  I’m asking engineering if this is something doable or not.  Since it’s just a convenience method around network.request() I would think this is something that we could do.

Lets see what they say.

Rob

Thanks Rob.  Hope to hear some good news soon.  :)