What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » How To Call Upon Random Files

How To Call Upon Random Files
Author: Message:
Vexor
Full Member
***

Avatar
Pure Capital Gain

Posts: 162
Reputation: 7
43 / Male / –
Joined: Jan 2006
O.P. RE: How To Call Upon Random Files
code:
function get_random(){
var ranNum=Math.floor(Math.random()*2);
return ranNum;
}

function getaSound(){
var whichSound=get_random();

var sound=new Array(2)
sound[0]="CHIMES.WAV";
sound[1]="LeaveMeAlone.mp3";
alert(sound[whichSound]);
}

function OnEvent_ChatWndCreated(ChatWnd){
var ChatWndContacts = ChatWnd.Contacts;
if(ChatWndContacts.Count == 1)
{
  var e = new Enumerator(ChatWndContacts);
  var Contact = e.item();
  {
   var fileName = getaSound();
   MsgPlus.DisplayToastContact(Messenger.MyName , "Has Just Opened A Window With" , Contact.Name , fileName);
  }
}
}





This still doe snot work and Ihave all that you have said to put in there. what am i missing here?

--EDIT--

code:
function getaSound(){
var whichSound=get_random();

var sound=new Array(2)
sound[0]="CHIMES.WAV";
sound[1]="LeaveMeAlone.mp3";
alert(sound[whichSound]);
}
was ment to be
code:
function getaSound(){
var whichSound=get_random();

var sound=new Array(2)
sound[0]="CHIMES.WAV";
sound[1]="LeaveMeAlone.mp3";
return sound[whichSound];
}

Sorry for your trouble. I got it working now.

Thank you all so much.

This post was edited on 07-24-2006 at 11:40 AM by Vexor.
[Testing A Bunch Of Different Betas']
[Image: DaFuca.png]
07-24-2006 11:38 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
How To Call Upon Random Files - by Vexor on 07-22-2006 at 09:45 AM
RE: How To Call Upon Random Files - by John Anderton on 07-22-2006 at 10:56 AM
RE: How To Call Upon Random Files - by Vexor on 07-22-2006 at 06:10 PM
RE: How To Call Upon Random Files - by -dt- on 07-22-2006 at 06:21 PM
RE: How To Call Upon Random Files - by Hengy on 07-22-2006 at 08:11 PM
RE: How To Call Upon Random Files - by Vexor on 07-23-2006 at 12:02 AM
RE: How To Call Upon Random Files - by cloudhunter on 07-23-2006 at 12:04 AM
RE: How To Call Upon Random Files - by Vexor on 07-24-2006 at 08:42 AM
RE: How To Call Upon Random Files - by Veggie on 07-24-2006 at 10:07 AM
RE: How To Call Upon Random Files - by Vexor on 07-24-2006 at 10:35 AM
RE: RE: How To Call Upon Random Files - by foaly on 07-24-2006 at 10:39 AM
RE: How To Call Upon Random Files - by Vexor on 07-24-2006 at 11:03 AM
RE: How To Call Upon Random Files - by Pai on 07-24-2006 at 11:25 AM
RE: How To Call Upon Random Files - by Vexor on 07-24-2006 at 11:38 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