源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

Flex中给按钮添加链接点击链接打开网页的方法

  • 时间:2021-06-08 00:41 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:Flex中给按钮添加链接点击链接打开网页的方法
Flex中如何给一个按钮添加链接,点击链接打开一个网页呢? 可以用 navigateToURL 或者 htmlText 实现,请看下面的例子
[u]复制代码[/u] 代码如下:
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="initApp()" layout="absolute" width="278" height="244"> <mx:Script> <![CDATA[ internal function initApp():void{ var str:String = "<a target='_blank' href='http://www.idceye.cn/'>草山狐随笔</a>";link.htmlText = str; } internal function openUrl():void{ navigateToURL(new URLRequest("http://www.idceye.cn/"), "_blank"); }]]> </mx:Script> <mx:Button x="72" y="117" label="草山狐随笔" fontSize="13" id="link2" click="openUrl()"/> <mx:Text id="link" text="idceye" x="72" y="47" fontSize="13"/> </mx:Application>
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部