PDA

View Full Version : Add child null to item



nickdigital
11-02-2011, 05:03 PM
I'm having a brain freeze. Why isn't this working?


selectedItem = Scene().getSelect();
AddNull("Null");
ParentItem(selectedItem);

evenflcw
11-02-2011, 06:24 PM
Because getSelect() returns an array (multiple values), but ParentItem() expects a single value.

So use firstSelect() instead, or subscript selectedItem[1], or selectedItem[selectedItem.count()] depending on what you want.

(I'm never sure about the order of LWs arrays, ie which is first and last selected item; Probably first in array is last selected, in somewhat typical LW backward fashion. lastSelect() would have made more sense to implement than firstSelect() imho.)

nickdigital
11-02-2011, 06:33 PM
Ah thx!