当前位置:首页>>平面设计教程>>Flash教程>>正文

flash form 中关于alert框的应用

文章出处:查爾斯實驗室 作者:查爾斯 发布时间:2006-06-02 收藏到QQ书签
关于在flash form中的判断应该,coldfusion中应该都有很优秀,漂亮的提示,但有的时候要用到弹出窗口来给客户来决定是继续做下去或是取消当前操作这样的情况,所以就是类似JS中的confirm的功能哦! 
  具体实施是这样来改造flash form的alert框的。 
alert("Are you sure you want to remove all records?", "Warning", mx.controls.Alert.OK | mx.controls.Alert.CANCEL,  myClickHandler); 
  在controls中加入两个warning要用到的button,来对其进行改造,让本身一个按钮的alert变成两个,这个技巧是在ASFUSION上得到的灵感,如果我的flash as够熟悉的话,我大概可以做的更精彩些,所以还需努力,
  
  <cfsavecontent variable="showAlert"> var myObj = {};  var myClickHandler = function (evt){ 
    if (evt.detail == mx.controls.Alert.OK){ 
                alert("Records deleted","Completed");        }}alert("Are you sure you want to remove all records?", "Warning", mx.controls.Alert.OK | mx.controls.Alert.CANCEL,  myClickHandler);</cfsavecontent>
<cfform name="myform" height="300" width="400" format="Flash" timeout="0" >  <cfformgroup type="hbox">
<cfinput type="Button" name="myBtn" onClick="#showAlert#" value="Show Alert" /> 

Google