Hello Riyaz,
CODE
// Change the 'src' property to point to local or remote image.
var myimage = new KONtx.element.Image({
// set to remote path
src: "http://images.smh.com.au/2010/01/27/1068848/pittjolie-420x0.jpg",
//"image/960x540/Forest.png", <= this is local path
// for devwidgets, you can try path, "../../myimage.jpg"
manageWaitIndicator: true,
styles: {
vAlign: "center",
hAlign: "center"
}
}).appendTo(this); // 'this' for ex. can be a fullscreen view.
As you can see the local path is relative to "Contents" folder of your widget. Thus, one can use "../.." to access to devwidgets. But, such folder i.e. devwidgets will not exist on OEM devices (TV) and accessing such folder will result in error on OEM (TV). This works though on simulator. You should load images present in your Contents folder of your widgets or load them from remote sites.
Regards,
Azhar
Thanks Azhar,
This is working. I can now access the nodes and attributes. One more, I couldn't find in the reference manual is how to display an Image on the widget. I want to display a local image stored at some folder in the /devwidget, at center of the screen. I see that there's an example of
var myImage = KONtx.element.Image({ ... etc in the manual but how to use it within KONtx.Class or outside this class is not mentioned. I would really appreciate for the help.
Riyaz