What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Pass object to a Wnd

Pass object to a Wnd
Author: Message:
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Pass object to a Wnd
quote:
Originally posted by Shondoit
I need some kind of method, to pass a custom Object to a PlusWnd, so I can use it again when the OnWindowEvent_CtrlClicked event fires....

i.e.
code:
function CreateWnd () {
   MyObject = new Object()
   MyObject.Name = "MyCustomObject"
   MyObject.Param = "ParamValue"
   var Wnd = MsgPlus.CreateWnd("windows.xml","settings")
   Wnd.CustomObject = MyObject
}
function OnSettingsEvent_CtrlClicked (Wnd, ControlId) {
   var MyObject = Wnd.CustomObject
   Debug.Trace(MyObject.Name)
}

This doesn't work, but I need something that has the same effect


make and declare your object variable as a global variable, not as a local one:
code:
var MyObject = new Object();

function CreateWnd () {
   MyObject.Name = "MyCustomObject"
   MyObject.Param = "ParamValue"
   var Wnd = MsgPlus.CreateWnd("windows.xml","settings")
}
function OnSettingsEvent_CtrlClicked (Wnd, ControlId) {
   Debug.Trace(MyObject.Name)
}
.-= A 'frrrrrrrituurrr' for Wacky =-.
08-11-2006 06:10 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Pass object to a Wnd - by Shondoit on 08-11-2006 at 01:56 PM
RE: Pass object to a Wnd - by -dt- on 08-11-2006 at 02:09 PM
RE: Pass object to a Wnd - by Shondoit on 08-11-2006 at 02:12 PM
RE: Pass object to a Wnd - by -dt- on 08-11-2006 at 02:16 PM
RE: Pass object to a Wnd - by CookieRevised on 08-11-2006 at 06:10 PM
RE: Pass object to a Wnd - by Shondoit on 08-11-2006 at 10:58 PM
RE: Pass object to a Wnd - by cooldude_i06 on 08-12-2006 at 05:40 AM
RE: RE: Pass object to a Wnd - by CookieRevised on 08-13-2006 at 09:28 AM
RE: Pass object to a Wnd - by Shondoit on 08-13-2006 at 12:46 PM
RE: Pass object to a Wnd - by CookieRevised on 08-13-2006 at 06:10 PM
RE: Pass object to a Wnd - by Shondoit on 08-13-2006 at 06:25 PM
RE: Pass object to a Wnd - by cooldude_i06 on 08-13-2006 at 06:44 PM
RE: RE: Pass object to a Wnd - by Shondoit on 08-13-2006 at 06:47 PM
RE: Pass object to a Wnd - by cooldude_i06 on 08-13-2006 at 06:54 PM
RE: RE: Pass object to a Wnd - by CookieRevised on 08-13-2006 at 10:27 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On