listactionscript-3comboboxflash-v3-components

ActionScript - ComboBox Is SelectableList?


i don't understand Adobe's documentation for the SelectableList class:

The SelectableList is the base class for all list-based components--for example, the List, TileList, DataGrid, and ComboBox components.

SelectableList isn't a base class for ComboBox:

SelectableList > BaseScrollPane > UIComponent > Sprite > DisplayObjectContainer > InteractiveObject > DisplayObject > EventDispatcher > Object

ComboBox > UIComponent > Sprite > DisplayObjectContainer > InteractiveObject > DisplayObject > EventDispatcher > Object

import fl.controls.*;

var l:List = new List();
trace(l is SeletableList); //true

var tl:TileList = new TileList();
trace(tl is SelectableList); //true

var dg:DataGrid = new DataGrid();
trace(dg is SelectableList); //true

var cb:ComboBox = new ComboBox();
trace(cb is SelectableList); //false

is this an error? or am i missing something?


Solution

  • It's just the way Adobe express themselves in the documentation sometimes: confusingly.

    To put it in simple OOP terms, it's the difference between extending a class("is a") and using composition("has a"):

    List, TileList, DataGrid is a Selectable List (because each one extends Selectable List)

    ComboBox has a Selectable List (because it has a List component, exposed through it's dropdown property(, which is a Selectable list)).

    Hope this makes it clear.