2010-11-14 92 views
0
<mx:StringValidator source="{ host_txt }" property="text" 
      tooShortError="This URI is shorter than the minimum allowed length." 
      minLength="8" trigger="{ connect_btn }" triggerEvent="click" 
      valid="setupConnection()"/> 

如何手動激活click event{ connect_btn }如何激活flex中的click事件?

回答

0

在這段代碼時connect_btn點擊它開始驗證文本中host_txt如果成功調用setupConnection()所以,只要我能理解你的問題,你想,當你按一下按鈕,請糾正我,如果我理解做別的事情它不正確,你通過給點擊屬性的值

<mx:Button label="button" id="connect_btn" click="yourMethod()"/> 

希望這是你想要的。

+0

我想要做的就像javascript中的'connect_btn.click()'... – ollydbg 2010-11-14 13:14:12