2

I'm using Actionscript 3 and Scaleform 4.1 to command an instance of a TileList in a Flash project (CS 5.5).

I have got the TileList populating with ListItemRenderer objects (basically buttons).

In my current situation, I need rows of 4, but I need to place 15 buttons (design requirement). The TileList automatically populates the final row with 3 buttons, and one Disabled state button (instead of a blank space).

So the question:

  • Can you prevent the TileList from placing Disabled buttons (ListItemRenderer) in remainder spaces?
  • Is the TileList required to fill a grid to capacity (with Disabled buttons if necessary)?
  • Can you force a TileList to leave remainder spaces empty?

Alternate solutions also welcome, i.e. can you add another state to the ListItemRenderer such as "blank"? If so, how would you force TileList to default to that instead of Disabled?

If there is good documentation available on this, I don't mind an RTFM reply with a link, but I haven't found anything after a couple days scrounging. Thanks!

4

1 回答 1

2

当然可以扩展或修改 TileList 以满足您的需要。这就是我们发布 CLIK 源代码的原因。但是为了回答您的问题,默认情况下,Tilelist 设置为使用空白/禁用的渲染器来处理空图块。

您可以在不扩展 tilelist 的情况下处理此问题,而是使用项目渲染器本身(无论如何显示自定义数据更常见)。“禁用”的渲染器都将调用它们的 setdata(null)。因此,在这种情况下,只需覆盖 setdata 即可切换可见性:

if ( data != null )
{
    //do stuff with data 
    visible = true; 
}
else
{
    visible = false;
}
于 2012-08-13T16:56:48.077 回答