PDA

View Full Version : How do I stop loading of images?


biguniverse
04-07-2007, 06:17 AM
I have a "thumbnail viewer" (modeldialog) that shows several images. However, before all the images have finished loading, the user might hit the cancel button to close the modaldialog. When that happens, how can I stop loading of the images in the background? Currently, the images continue loading, which slows the rest of the app down till the images have finished loading in the "background".

I've provided the code excerpt below. I'm using "datapath" to get the images using a dataset. I've tried everything from close, destroy, unload, etc. but the images continue to load in the background:

<view name="vthinborder" width="${(canvas.width / 5)+2}" height="${(canvas.height / 5)+2}"
x="5" y="5" bgcolor="#999999">
<image id="vthumbnailimage"
datapath="@image"
width="${(canvas.width / 5)}" height="${(canvas.height / 5)}"
stretches="both"
valign="middle" align="center"
onclick="vthumbnailimage.unload(); mdthumbnail.close(); vmain.gotoImage(this.datapath.getNodeAttribute('im age'));"/>
</view>