quote:
Originally posted by Drakal
thx.. now i se that my old timer didnt loop but what should "oPlusWnd" be? window worked befor and window was msgplus.createwnd(....) but now in timer it just opens alot of windows until it reaches 100%
You'll need to create a global variable and set that to the created window, and when it's destroyed you clear the variable again. When you declare it as global, you can use it wherever you like. I think you'll understand it better with the following style example:
code:
var MainWnd = false;
function OpenThingy() {
MainWnd = MsgPlus.CreateWnd("XML", "WINDOWID");
//Other stuff, like the timer
Progress_SetStep(MainWnd.Handle, "PROGRESS", 10);
MsgPlus.AddTimer("MyTimer", 500);
}
function OnEvent_Timer(sTimerId) {
if(sTimerId == "MyTimer" && MainWnd != false) {
//Do timer stuff
Progress_StepIt(MainWnd.Handle, "PROGRESS");
//Re-create timer
MsgPlus.AddTimer("MyTimer", 500);
}
}
function OnWINDOWIDEvent_Destroyed(PlusWnd) {
MsgPlus.CancelTimer("MyTimer"); //Cancel timer
MainWnd = false; //Clear global variable
}