I create a custom component to override the linkButton to make it behave that if an exist value is found, it would shown as "Added".
By default the button label is "Add to cart", I could not make the button become "Added" after trying many trial and error on uHandler which I suppose, COMPLETE, ENTER_FRAME, CREATION_COMPLETE could not even update the label.
public class Btn extends LinkButton{
public function Btn(){
super();
this.addEventListener(MouseEvent.CLICK, labelHandler);
this.addEventListener(FlexEvent.INITIALIZE, loopArray);
this.addEventListener(FlexEvent.PREINITIALIZE, cHandler);
this.addEventListener(Event.COMPLETE, uHandler);
}
...
private var disableLabel:int = 0;
private function uHandler(event:Event):void {
trace("creation");
if(disableLabel == 1){
super.label = "Already added";
disableLabel = 0;
}
}
Please advice.