Flex的组件,如LinkButton

在mxml中设置属性时,可有

<mx:LinkButton label="百度" fontSize="12" textDecoration="underline" fontWeight="normal" icon="@Embed(source='icons/icon_attachment.gif')"
		        click="gotoLink()"/>

但是,如果在as中 var newLink:LinkButton=new LinkButton();

newLink不可以直接设置textDecoration或icon等属性

应该设置类型:

var newLink:LinkButton=new LinkButton();
            		newLink.setStyle("icon",linkBicon);
            		newLink.label=ac_links[i].name;
            		newLink.setStyle("fontSize",12);
            		newLink.name=ac_links[i].value;
            		newLink.setStyle("textDecoration","underline");
            		newLink.addEventListener(MouseEvent.CLICK,gotoLink);

相关文章:

  • 2022-12-23
  • 2021-05-06
  • 2021-10-01
  • 2021-05-29
  • 2022-12-23
  • 2022-01-07
猜你喜欢
  • 2022-01-27
  • 2021-08-31
  • 2022-12-23
  • 2022-12-23
  • 2022-01-09
  • 2021-07-19
  • 2022-12-23
相关资源
相似解决方案