Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - The creature

#1
Code: ags
Function game_start()
{
Listbox_Contacts.AddItem("Contact1");
Listbox_Contacts.SelectedIndex=-1;
}


Function repeatedly_execute()
{
 String CurrentContact = Listbox_Contacts.Items[Listbox_Contacts.SelectedIndex];

If(CurrentContact=="Contact1")
{
gContactGUI.Visible=true;
}
}


The error is: Invalid index specified.
#2
As the post title says: is there a way to have no items selected when a listbox is displayed. By default, the first item is always selected.

I'm sure there is a way as it was asked in the forum a while a go, but I've made a forum search and found nothing and I can't find anything in the manual about having all items deselected.

If I set the selectedIndex to -1 (like it says in the manual) it works. But, in a repeatedly executed I'm selecting items via string names and when I do this I get a compile error

Any help would be great.

Chris.
#3
Looking gorgeous. Love the character portraits!
SMF spam blocked by CleanTalk