Closed crooksy88 closed 8 years ago
If you've specified a single select popover.
private var data:Array = ["Mr", "Mrs", "Miss", "Ms"];
...
Dialog.service.showSelectPopover(1,"Title", data, options );
...
private function popover_changeHandler( event:PopoverEvent ):void
{
if (event.id == 1)
{
// event.selection is an array of selected indexes into the data array
// with a single select it will only contain one item (but may contain none)
if (event.selection.length > 0)
trace( data[ event.selection[0] ] );
}
}
Could someone point out how I access the selected value when a popover item is selected?
e.g. Dialog.service.showSelectPopover(1,"Title",["Mr","Mrs","Miss","Ms"],options);
private function popover_changeHandler( event:PopoverEvent ):void { if (event.id == 1) { Dialog.service.dismissPopover( 1 ); trace( "The user changed the selection in the popover to " +event...);
}
}
So if I select Mrs the trace would read: The user changed the selection in the popover to Mrs
Thanks,
Mark