Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Drop down option menu for multiple videos?

Xeaustin Twine
Registered User
Join date: 31 Jul 2008
Posts: 15
08-12-2008 23:57
Hi,
I need to display more than one videos on my one prim.so that I have to list my video`s option in drop down option menu.How can I generate that drop down menu option menu to display more videos at one prim?If any script is need for that pls give me that script..
My needs are below.
I have to set one prim which am going to display my videos.If anyone touch that prim then the drop down option menu is provide options for various videos.when user touch one of these option then that specific video has to be run. these are all my needs..pls tell me solution for that as quick as possible..
Pedro McMillan
SLOODLE Developer
Join date: 28 Jul 2007
Posts: 231
08-13-2008 03:14
You could try something like this (you'll need to customize the lists of video names and URLs... but make sure the lists aren't longer than 12 items, otherwise the dialog won't work):

CODE

list videoNames = ["Video1", "Video2", "Video3"];
list videoUrls = ["http://www.myvideo.com/1", "http://www.myvideo.com/2", "http://www.myvideo.com/3"];

integer DIALOG_CHANNEL = 174632;

default
{
state_entry()
{
llListen(DIALOG_CHANNEL, "", NULL_KEY, "");
}

touch_start(integer num)
{
llDialog(llDetectedKey(0), "Select a video:", videoNames, DIALOG_CHANNEL);
}

listen(integer channel, string name, key id, string msg)
{
integer pos = llListFindList(videoNames, msg);
if (pos < 0) return;

llParcelMediaCommandList( [
PARCEL_MEDIA_COMMAND_STOP,
PARCEL_MEDIA_COMMAND_URL, llList2String(videoUrls, pos),
PARCEL_MEDIA_COMMAND_PLAY
]);
}
}




(Sorry if there are any errors... just coding of the top of my head!)

NOTE: you need to be the land-owner for this to work. It will also work on group-owned land, so long as you deed the object to the group.
bucky Barkley
Registered User
Join date: 15 May 2006
Posts: 200
08-13-2008 12:42
Contact me in-world. VidMon reads from a notecard and lets you browse through many items (say.. 20-30). I am about to reopen my store, and this is going to be free for personal/edu/non-profit - donation for commercial.
_____________________
Bucky Barkley -- Mammal, Scripter, Builder, Lover
Xeaustin Twine
Registered User
Join date: 31 Jul 2008
Posts: 15
please rectify that error..
08-18-2008 22:07
Hi Pedro first all thanks for your reply.
while using your code I got one Error,that error is
";(19,44):ERROR: Function call mismatches type or number of arguments".that was the error what I got.
that error is on line of " llListFindList(videoNames, msg); "










From: Pedro McMillan
You could try something like this (you'll need to customize the lists of video names and URLs... but make sure the lists aren't longer than 12 items, otherwise the dialog won't work):

CODE

list videoNames = ["Video1", "Video2", "Video3"];
list videoUrls = ["http://www.myvideo.com/1", "http://www.myvideo.com/2", "http://www.myvideo.com/3"];

integer DIALOG_CHANNEL = 174632;

default
{
state_entry()
{
llListen(DIALOG_CHANNEL, "", NULL_KEY, "");
}

touch_start(integer num)
{
llDialog(llDetectedKey(0), "Select a video:", videoNames, DIALOG_CHANNEL);
}

listen(integer channel, string name, key id, string msg)
{
integer pos = llListFindList(videoNames, msg);
if (pos < 0) return;

llParcelMediaCommandList( [
PARCEL_MEDIA_COMMAND_STOP,
PARCEL_MEDIA_COMMAND_URL, llList2String(videoUrls, pos),
PARCEL_MEDIA_COMMAND_PLAY
]);
}
}




(Sorry if there are any errors... just coding of the top of my head!)

NOTE: you need to be the land-owner for this to work. It will also work on group-owned land, so long as you deed the object to the group.
Pedro McMillan
SLOODLE Developer
Join date: 28 Jul 2007
Posts: 231
08-19-2008 02:12
Oh sorry... doh! You'll need to put [msg] instead of just msg, like this:

llListFindList(videoNames, [msg]);

(This reason is that llListFindList is trying to find a list within a list. The videoNames variable is a list, but msg is a string, so we need to create a list which contains just the msg string in order to search with it. I hope that makes sense! :))
Xeaustin Twine
Registered User
Join date: 31 Jul 2008
Posts: 15
Thanks alot Pedro
08-19-2008 03:58
Hey,
its working ya..thank you very much.

From: Pedro McMillan
Oh sorry... doh! You'll need to put [msg] instead of just msg, like this:

llListFindList(videoNames, [msg]);

(This reason is that llListFindList is trying to find a list within a list. The videoNames variable is a list, but msg is a string, so we need to create a list which contains just the msg string in order to search with it. I hope that makes sense! :))