示例语言:AS3
代码:
private var _UID:String;
private function copyText():void{
var wx:Object = Browser.window.wx;
wx.setClipboardData({
data: _UID,
success: function(res):void{
wx.showModal({
title: '提示',
content: '复制成功',
success: function(res):void {
/*if (res.confirm) {
console.log('确定')
} else if (res.cancel) {
console.log('取消')
}*/
}
})
}
});
}
解释1:获取微信的浏览器
var wx:Object = Browser.window.wx;
wx.setClipboardData
等同用法:引擎会自动识别
__JS__('wx').setClipboardData
网友评论