开发者

replace button label

开发者 https://www.devze.com 2022-12-11 22:30 出处:网络
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.

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

精彩评论

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