Flex 中保存文件对话框中显示默认文件名

var file:File;

protected function browseButton_clickHandler(event:MouseEvent):void
{
    var zipFileName:String = "\\test.zip ";
    if(null == file){
     file = new File(zipFileName);
    }
    file.addEventListener(Event.SELECT,saveFileSelectHandler);
    file.browseForSave("Save archive copy as");
}

 

protected function saveFileSelectHandler(event:Event):void
{
    saveFileTxt.text = file.nativePath;
    downLoadPath = "file://"+file.nativePath;
}

 

<s:Group top="0" left="10" right="0" bottom="10" excludeFrom="exporting,exported">
  <s:layout>
   <s:VerticalLayout gap="-5" paddingLeft="17" paddingRight="17" paddingBottom="13" paddingTop="25" />
  </s:layout>
  <s:VGroup width="100%" paddingLeft="8" paddingRight="8" paddingBottom="6" paddingTop="6">
   <s:Label text="Please choose where to save exported project"/>
   <s:HGroup width="100%" height="25" verticalAlign="middle" paddingLeft="24">
    <s:TextInput id="saveFileTxt" width="400" textAlign="left" editable="false"/>
    <s:Button id="browseButton" label="Browse" click="browseButton_clickHandler(event)"
        height="100%" buttonMode="true" right="3"/>
   </s:HGroup>
  </s:VGroup>
</s:Group>

 

效果如下图:




 

 
 

 

 



 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值