What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Whats wrong with that var declaration?

Whats wrong with that var declaration?
Author: Message:
markee
Veteran Member
*****

Avatar

Posts: 1621
Reputation: 50
36 / Male / Flag
Joined: Jan 2006
RE: Whats wrong with that var declaration?
code:
var x_img = 0; //set x_img as a global variable

function OnEvent_Timer(sTimerId) //sTimerId is a variable not what timer is being initiated
{
    if (sTimerId == "slider" && Messenger.MyStatus == 3)//make sure it is the right timer being initiated AND the status you wanted
    {
        x_img++;//add 1 to x_img
       
        if(x_img == 1)
        {
            Messenger.MyDisplayPicture = MsgPlus.ScriptFilesPath + "\\images\\online2.jpg";
        }
        else if(x_img == 2)//used "else if" as this links if statements and only oe can be true
        {
            Messenger.MyDisplayPicture = MsgPlus.ScriptFilesPath + "\\images\\online3.jpg";
        }
        else if(x_img == 3)
        {
            Messenger.MyDisplayPicture = MsgPlus.ScriptFilesPath + "\\images\\online4.jpg";
        }
        else if(x_img == 4)
        {
            Messenger.MyDisplayPicture = MsgPlus.ScriptFilesPath + "\\images\\online.jpg";
            x_img = 0;
        }
        MsgPlus.AddTimer("slider", 20000);
    }
}
I added some note so you can understand the changes that have been made by mickael9.  I hope this gives you more understanding of what is happening.
[Image: markee.png]
08-17-2006 01:24 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Whats wrong with that var declaration? - by SmashD on 08-17-2006 at 01:12 PM
RE: Whats wrong with that var declaration? - by mickael9 on 08-17-2006 at 01:18 PM
RE: Whats wrong with that var declaration? - by markee on 08-17-2006 at 01:24 PM
RE: Whats wrong with that var declaration? - by SmashD on 08-17-2006 at 01:28 PM
RE: Whats wrong with that var declaration? - by RaceProUK on 08-17-2006 at 02:24 PM
RE: Whats wrong with that var declaration? - by markee on 08-17-2006 at 02:32 PM
RE: Whats wrong with that var declaration? - by RaceProUK on 08-17-2006 at 08:38 PM
RE: Whats wrong with that var declaration? - by hmaster on 08-17-2006 at 08:44 PM
RE: Whats wrong with that var declaration? - by RaceProUK on 08-17-2006 at 08:48 PM
RE: Whats wrong with that var declaration? - by hmaster on 08-17-2006 at 09:02 PM
RE: RE: Whats wrong with that var declaration? - by CookieRevised on 08-18-2006 at 12:00 AM
RE: Whats wrong with that var declaration? - by Stigmata on 08-18-2006 at 12:13 AM


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