I am trying to download the following image over IP:
...using the following code (closely based on the example on p45/46 of v1.1 of the ProntoScript dev guide):
--------------------------------------------------------------
var socket = new TCPSocket();
var receivedData = "";
socket.onConnect = function() {
socket.write("GET /uploadtop/v/visual_nustraks.jpg" + " HTTP/1.1\r\n\r\n");
};
socket.onData = function() {
receivedData += socket.read();
};
socket.onIOError = function (e) {
CF.widget("output").label = "IOError " + e;
};
socket.onClose = function () {
// remove the HTTP information from the received data
var imageStartIndex = receivedData.indexOf("\r\n\r\n");
var bitmapData = receivedData.substring(imageStartIndex+4);
// make and display the image
var MyImage = new Image(bitmapData);
CF.widget("output").setImage(MyImage);
};
// MAIN
socket.connect('static.tvgids.nl', 80, 6000);
--------------------------------------------------------------
I don't get any picture displayed in my "output" panel !?
Any suggestions (or working example to start with...) ?