【发布时间】:2017-05-17 08:11:28
【问题描述】:
我制作音乐播放器并使用 FileFilter 过滤 mp3 和 .. 文件。
这是我的代码:
<![CDATA[
import flash.events.IOErrorEvent;
import flash.events.ProgressEvent;
import flash.media.Sound;
import flash.media.SoundChannel;
import flash.media.SoundTransform;
import flash.net.URLRequest;
private var sound:Sound;
private var songLength:String;
private var soundChannel:SoundChannel;
[Bindable]
private var readyToPlay:Boolean = false;
[Bindable]
private var playing:Boolean = false;
private var file:File;
private var filter:FileFilter = new FileFilter("Music", "*.mp3;*.ogg");
protected function browse_clickHandler(event:MouseEvent):void {
file = new File();
file.addEventListener(Event.SELECT, onFileSelect);
file.browseForDirectory("Open",[filter]);
}
这一行有错误:
file.browseForDirectory("打开",[过滤器]);
1137:参数数量不正确。预计不超过 1 个。
谢谢
【问题讨论】:
标签: actionscript-3 flash apache-flex air flash-builder