Ask a Question related to Macromedia Flash Flashcom, Design and Development.

  1. #1

    Default Using File.list()

    Hi,
    Im using FMS 3 on the server side when onConnect occures i need an array of
    all file that is the directory root/streams/myApp
    how do use the File.list() ? do i need to create a new file just for getting
    the list of files of the directory? and how do i get to do that on the
    directory i want ? is it like this:
    File.list(function(name){ return name.indexOf("streams/myApp/")!=-1);
    i so the example in the doc files :
    var a = x.currentDir.list(function(name){return name.length==3;});
    does x is a File object? and where the currentDir came from its not a File
    property?

    Please help ...


    inwonder Guest

  2. Similar Questions and Discussions

    1. File list() error
      When I invoke myfile.list() where myfile is a directory, I get the following: File operation File.position failed. File is in closed...
    2. Creating a File List
      Hy, I'm trying to create a extension that has a drop-down list of all the documents of a certain document type, how can I do this. Thanks
    3. Refresh file list...
      I was updating and forgot to add a file. I went to verify the updates and it errored out and said that it could not find that file. I then uploaded...
    4. Recent File List
      Does ID-cs 3.01 have a recent files list? I seem to remember seeing it in the file menu ... but it is no longer there (not even disabled). I...
    5. File List
      I have a public directory on my server where I would like make a link point to it to show a list of files within. The list is to show the file name,...
  3. #2

    Default Re: Using File.list()

    In SSAS, File objects represent both files and directories.

    The "x" in the examples just means "arbitrary thing that has a member of
    whatever type we're talking about." In this case, "x" is something that has a
    member called "currentDir" that's a File object (presumably representing the
    current directory).

    I'm pretty sure you can create an equivalent like this:

    currentDir = File(".");

    Also, your search isn't going to work the way you expected. The find function
    doesn't search all subfolders recursively, and the name parameter only gets the
    filename (the last component of the path), not the entire pathname. You're
    going to want to open streams/myApp as a File, then just list everything in it.


    abarnert Guest

  4. #3

    Default Re: Using File.list()

    Hi,
    first thank, second i'm not sure that File(".") gives the current directory
    because when i tried it and then trace x.name i got nothing also it faild open
    it. but how do i move to the directory i want the best was if i could create
    this file object on the directory where all the files i want are. but how do i
    do that . i tried x.position = "/streams/myapp" but i don't think that what it
    ment for. so any idea?


    inwonder Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139