You are here

Working with the List component in Director

Lately I have been working with Flash Components in Director to some extend. There's a bug in the way the Flash Xtra handles 'undefined' values that's proving rather inconvenient.

When no items are selected in the List Component, selectedIndex, selectedIndices, selectedItem and selectedItems are all set to 'undefined' in Flash. Unfortunately, the Flash Xtra thinks that means the property does not exist, and an error is thrown in Director when getting the property: property not found.

The Quirklist entry above suggests using JavaScript to work around this, but I have found a Lingo-only workaround. I noticed that there are a number of undocumented methods for the list component:
getSelectedIndex(), getSelectedIndices(), getSelectedItem() and getSelectedItems().
These methods can be called from Director, and they result in 'void' if no item is selected, instead of an error!

Topics: 

Comments

Dude, you have just saved my day!

i m newbie, i m stuck on almost same point. i draw list component from toolbar, add labels and data arrays. now i want to capture roll over items and items click events, how can i code those in lingo, can u give a simple demo file to help, will be greatful
regards, lala