PDA

View Full Version : setting resource to an image at run time


Peter_Chea
06-25-2003, 12:19 PM
Hi Antun, I am trying to use setResource to load images at run time. But I am not getting any output. Does the setResource method work with image files or work only with named resources?


<datapath xpath="item" pooling="true" />
<view datapath="">
<view datapath="" width="31" height="25" oninit="updateResource()" ondata="updateResource()">
<method name="updateResource">
var logo = "images/AirlineLogos/" + logo + parent.datapath.getXPath("logo/text()") ;
debug.write(logo);
this.setResource(logo);
</method>
</view>
<text datapath="airline/text()" multiline="true"/>
<simplelayout axis="x"/>
</view>

hqm
06-25-2003, 12:58 PM
I believe you have to use setSource() to load
a resource over the network. The difference between
setResource and setSource, as I understand it, is setResource can only refer to an identifier that was compiled in to the app with a <resource> tag. setSource can refer to a URL.

Confusing method names? Hell yes!

Peter_Chea
06-25-2003, 01:04 PM
Thanks, that is what I needed. I didn't realize there is a second method for setting images.