开发者

replace button label

In actionscript, when I click a button I would like the label to replace from "add to list" to "added" without override with super method.

Is this even possible to change la开发者_C百科bel in repeater?


You shouldn't have to override with a super method, though this is a decent way to do it. I would have the logic work something like this:

  • write a custom component that contains the button.
  • put the button in the repeater
  • on button click, tell the array to add an item to it, and listen for "itemAdded" on the arrayCollection class.
  • when you hear "itemAdded" inside the button container class, check to see if it is the item you added. If so, change your button's label to "Added" through button.label = "Added".

I think this should work just fine - best of luck.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜