点击浏览该文件
function MyFunc(arg){ import mx.controls.Alert; Alert.okLabel = "I Know"; var myAlert = Alert.show(arg, "提示", Alert.OK | Alert.CANCEL, _root, myClickHandler, "inforIcon", Alert.OK); } _root.createTextField("myTextField",1,200,100,300,20) myTextField.html=true; myTextField.htmlText ="<A HREF=\"asfunction:MyFunc,I LOVE YOU\">Click Me!</A>";
说明:
在此示例中,定义了 MyFunc() 函数。TextField 对象 myTextField 与 HTML 文本字段相关联。文本“Click Me!”是文本字段中的一个超链接。当用户单击该超链接时,将调用 MyFunc() 函数:
myTextField.htmlText ="<A HREF=\"asfunction:MyFunc,I LOVE YOU\">Click Me!</A>"; 在单击该超链接后,I LOVE YOU出现在Alert中 |