Hi.
I'm still a bit new at coding MSG Plus! scripts. I have made this script:
code:
function OnEvent_Initialize(MessengerStart)
{
StartDownload();
}
function StartDownload()
{
var HTTP = new ActiveXObject("Microsoft.XMLHTTP");
var XML = new ActiveXObject( "Microsoft.XMLDOM" );
HTTP.onreadystatechange = function()
{
if((HTTP.readyState == 4) && (HTTP.status == 200))
{
var Feed = HTTP.responseText;
XML.loadXML(Feed);
var Image = XML.getElementsByTagName("title")[1].text;
var Width = XML.getElementsByTagName("title")[2].text;
var Height = XML.getElementsByTagName("title")[3].text;
MsgPlus.DownloadFile(Image);
}
}
HTTP.open("POST", "http://www.snuzzer.dk/msgplus/php/explosmnet.php", false);
HTTP.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
HTTP.send("");
}
function OnEvent_DownloadFileComplete(URL, OutFile, Success)
{
if(Success)
{
ComicWnd = MsgPlus.CreateWnd("comic.xml", "TodaysComic");
ComicWnd.ImageElmt_SetImageFile("DisplayComic", "\\" + OutFile);
ComicWnd = Interop.Call("user32.dll", "SetWindowPos", ComicWnd.Handle, 0, 0, 0, Width, Height, 18);
}
}
My problem is, that the debugger says, that
Width and
Height isn't defined. Can someone please tell me what it gives me that error?
Thanks in advance.
Simon