mardi 3 janvier 2017

AS3 Flash Builder Error Incorrect number of arguments

i make music player and use FileFilter for filter mp3 and .. files .
this is my code :

<![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]);
            }

error in this line :

file.browseForDirectory("Open",[filter]);

1137: Incorrect number of arguments. Expected no more than 1.

thank you

Aucun commentaire:

Enregistrer un commentaire