flex中.mxml中获取上传文件的路径,绝对不是js回调函数
看到很多帖子都是用js回调获取文件上传路径的,但不满足我的需求,先将我的代码贴出来,希望对大家有点帮助(下面引的import是自己项目下的,如果报错,删除即可) ? <?xml version="1.0" encoding="utf-8"?> ???private var fileRef:FileReference=new FileReference();?? ???protected function closeWindow() : void ???{ ????PopUpManager.removePopUp(this); ????EnabledMenuBarEvent.dispatcher.dispatchEvent(new EnabledMenuBarEvent(EnabledMenuBarEvent.REFRESH_MENUBAR,true)); ???} ??]]> ?</fx:Script> ? ? ?<fx:Declarations> ??<!-- 将非可视元素(例如服务、值对象)放在此处 --> ?</fx:Declarations> ?<s:Panel x="68" y="70" width="510" height="253" title="软件注册"> ??<s:Button x="419" y="82" label="打 开" click="open_clickHandler()"/> ??<s:Button x="114" y="124" label="注 册" click="fileSelectHandler(event)"/> ??<s:Button x="202" y="125" label="关 闭" click="closeWindow()"/> ??<s:Label x="28" y="79" height="23" text="选择导入文件 :"/> ??<s:TextInput id="filePath" x="114" y="79" width="295" height="23"/> ?</s:Panel> </s:Application> (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |