This content has been marked as final. Show 3 replies
I've discovered, that I can acess the list of selections through
But when no one element in list is selected, this lines gives an error -
property not found
How can I check if some elements is selected in list, so that id soes not
cause en error in script?
"forums.adobe.com" <email@example.com> wrote in message
> I want to use a list flash component in Director
> I can set the content of listitems with following command
> sprite("listspr").member.labels = ["item 1", "item 2", "item3"]
> I've set multyselection property of the list to true, using Property
> Now the question - how can I define, what is the current selection in this
> Commands like sprite("listspr").member.selectedItems or
> sprite("listspr").member.selectedIndeces ends with an error.
> What is the correct code to define current selection in the list
> Any help will be appreciated
The code (handler) you need to know if no one item selected and get an empy list instead is:
vAnySelected = sprite("listspr")["selectedItems"]
if voidP(vAnySelected) then
I hope this can help you and leave you anothe behavior script below for your use :).
I have a similar problem, and these codes don't seem to work. I'm not using SelectedItems though, I have a code "sprite(5).SelectedItem.data" and user can only select one value from the list. If nothing is selected, I get a property not found #SelectedItem error. Otherwise everything works, I just need to get rid of that message... any ideas?